Select to view content in your preferred language

How to write polygon value to point feature class based on geometric intersection

256
2
Jump to solution
03-15-2026 08:17 PM
ScumBagsSurfer
Occasional Contributor

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
}

 

 

 

0 Kudos
1 Solution

Accepted Solutions
ScumBagsSurfer
Occasional Contributor
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 None

Calculated the field using Python.

View solution in original post

0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor

As you have posted your question in the ArcPro group I will assume you are seeking an Arcpro solution. Simply add the 2 layers to your map and run the Add Spatial Join tool and make sure Permanently Join Fields is checked on if you want the field from your polygon dataset to be permanently transferred into your point dataset.

0 Kudos
ScumBagsSurfer
Occasional Contributor
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 None

Calculated the field using Python.

0 Kudos