Buffer then get Average score

700
3
03-19-2019 12:21 PM
RickeyFight
MVP Regular Contributor

Select all polygon with 40 meters of a selected polygon and then get an average value of one of the attributes from the selected polygons.

I need to do this for each of the buildings within a city. 

I am thinking I need a for each statement but I am not sure.

Any help is greatly appreciated.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

maybe, but a Spatial Join might get your there if you specify an appropriate

join_operation, join_type, field_mapping, match_option, and search_radius,

Spatial Join—Help | ArcGIS Desktop 

Your code might help, but `for loops` can often be replaced by things like list comprehensions

ChrisSnyder
Regular Contributor III

GenerateNearTable tool would be faster than a SelectByLocation in a for loop.

... then probably just SummaryStatistics based on the BUILDING_ID as the case field (mean value of the other featureclass)

No programming required!

RickeyFight
MVP Regular Contributor

So Summarize Within—Help | ArcGIS Desktop   was the tool I thought would work but I guess it does not find the sum of the polygons that touch the buffer. I get some average number for the percent that is within my buffer. I am not sure why this is happening. 

0 Kudos