I have a point layer, and a polygon layer, and I wish to calculate the value of an attribute from the polygon layer at each point's location. Eg, find the area of the polygon which is found at each point, and write it to the point's attribute table:
One simple approach is to perform a spatial join - but this creates a new output point layer. I would prefer to update the existing point layer.
I could iterate through the points layer and:
- obtain each point's OBJECTID
- create a layer from the selected point, using the OID as the
Where clause
- perform a Select By Location, using the above layer as the
select_features
- iterate through the selected polygon(s) and write the Area value to the point
Steps 2 and 3 seem a bit extraneous - is there a programmatic way to obtain the value of a layer based solely on an XY coordinate?
This would be akin to using the Identify tool in ArcMap, whereby clicking on a location reveals the attributes of the layers at that location.