I'm trying to compute area-weighted averages of a field when dissolving a feature layer. I thought the solution would be to:
- create a new field that is the product of the original field value and the original shape area:
new_field = !original_field!*!Shape_Area!
- Perform the dissolve on field
my_class
with theSUM
statistic fornew_field
:SUM_new_field = Sum(new_field)
- Divide
new_field
by the dissolved feature area:aw_field = !SUM_new_field!/!Shape_Area!
.
I additionally want to use single-part features only, so I uncheck the "multipart features" option in Dissolve. However, the result is that the values of aw_field
is identical for every feature of a given value of my_class
. It appears that ArcGIS first dissolves into multi-part features, does the statistics computation on the multi-part features, and then splits the multi-part features into single-part features and simply assigns the multi-part feature value of the statistics field to each resulting single-part feature.
What is the most efficient work-around to get an area-weighted average for dissolved single-part features? I can see a procedure where you first dissolve into single-part features with no statistics, use the resulting layer as an identity feature or for zonal statistics on the original layer, and then join those results back to the dissolved feature... but that seems obnoxious and needlessly computer-intensive. Does anyone have a better idea?