Hello,
I am trying to write polygon values to a point feature class based on an intersection of geometries.
My polygon feature class is called 'Locations' with the intended field to copy being 'Location'.
The point feature class is called 'Record'.
My two feature classes are hosted feature classes on AGOL, with the point being collected with Survey123.
I have started to try and do it through field calculating in ArcGIS Pro, but if it is possible in Data Pipelines or FME automatically taht would be good too
// 1. Connect to the polygon layer via Portal()
var polygonFS = FeatureSetByPortalItemId(
Portal(),
"YOUR_PORTAL_ITEM_ID_HERE", // Replace with your polygon layer's item ID
0 // Layer index (0 = first layer)
);
// 2. Find the polygon that intersects the current point feature
var matchedPolygon = First(Intersects(polygonFS, $feature));
// 3. Return the polygon's attribute value
if (IsEmpty(matchedPolygon)) {
return null; // No polygon found
} else {
return matchedPolygon["YOUR_POLYGON_FIELD_NAME"]; // Replace with your field name
}