Hello,
I want to create an automated scheduled task with Notebooks/Python working with hosted feature layers, where polygon values are written to point features based on an intersection of geometry.
I have 2 point feature classes, let's call them:
PointFC1
PointFC2
and 2 polygon feature classes, let's call them:
PolyFC1
PolyFC2
I would like to write PolyFC1 'Location' field to PointFC1 and PointFC2 'Location' field, and write PolyFC2 'Zone' to PointFC1 and PointFC2 'Zone' fields based on whether those point features fall within the boundary of said polygons. I would only like to run this calculation on points where 'Location' or 'Zone' is '<Null>', so redundant processing is removed.
I have done this in ArcGIS Pro with field calculations via Python on the individual layers with:
getZone(!Shape!)
------------------------------------------------------
import arcpy
def getZone(point_geom):
polygon_layer = "polygon_layer" # just the layer name as it appears in ArcGIS Pro
with arcpy.da.SearchCursor(polygon_layer, ["SHAPE@", "field_name"]) as cursor:
for row in cursor:
if row[0].contains(point_geom):
return row[1]
return NoneI now want to group all the field calculations and run an automated task on them fortnightly, while only doing the points that are <Null> in those fields, as both point feature classes link to a Survey123 form where data is collected daily. That way, only features that need to be processed are processed.
Any help on this would be much appreciated.
Cheers.