HOW TO

Overwrite point attribute values based on polygon intersections using Python in ArcGIS Pro

First Published: June 2, 2026
Last Published: June 2, 2026

Summary

In ArcGIS Pro, the Spatial Join and Add Spatial Join geoprocessing tools apply fixed, parameter-based logic to populate point attribute values based on spatial relationships with polygon features. However, these tools provide limited support for applying conditional logic during the operation. In this workflow, Python is used within the Calculate Field geoprocessing tool to apply user-defined conditional logic, allowing control over how and when point attribute values are overwritten using values from intersecting polygon features.

Procedure

  1. In ArcGIS Pro, open the project.
  2. In the Contents pane, right-click the point layer and click Attribute Table. In this example, it is Point_Test.
The Attribute Table option
  1. In the attribute field, right-click the field to overwrite and click Calculate Field. In this example, it is Region.
The Calculate Field tool option
  1. In the Calculate Field window, configure the following parameters:
    1. For Expression Type, ensure the default Python option is selected from the drop-down menu.
    2. For Expression, copy the code below and paste it in the expression box. Replace <field1> and <field2> by double-clicking the fields in the Fields list. In this example, the SHAPE and Region fields are used.
getPolyValue(<field1>,<field2>)
The field selected from the Fields list
  1. In the Code Block box, copy and paste the code below to overwrite the point attribute value with the intersecting value from the polygon features.
Note:   
The full script must be run at once.
  1. Import ArcPy library.
import arcpy
  1. Retrieve the path of the polygon feature class. Replace <Polygon_fc> with the name of the polygon feature class.
Polygon_functionName = arcpy.Describe("Polygon_fc").catalogPath
  1. Retrieve the polygon attribute value to update the intersecting point features. Replace <Target_field> with the name of the field to overwrite.
def getPolyValue(pt, current_value):
    with arcpy.da.SearchCursor(
        polygon_fc,
        ("<Target_field>",),
  1. Apply a spatial filter to evaluate the intersecting values.
spatial_filter=pt,
        spatial_relationship="INTERSECTS"
    )
  1. Overwrite the point feature class value using the value from the intersecting polygon feature.
as cursor:
        for row in cursor:
            return row[0]
  1. Preserve the point feature class value when there is no intersection with the polygon feature.
return current_value

The code below shows the full sample script.

import arcpy

# Get the feature class path (not the layer name)
polygon_fc = arcpy.Describe("Polygon_Test").catalogPath

def getPolyValue(pt, current_value):
    with arcpy.da.SearchCursor(
        polygon_fc,
        ("Region",),
        spatial_filter=pt,
        spatial_relationship="INTERSECTS"
    ) as cursor:
        for row in cursor:
            # Overwrite when polygon intersects
            return row[0]

    # No intersecting polygon → keep original point value
    return current_value
  1. Click Verify The Verify icon to validate the expression.
  2. Click Apply > OK.

The attribute table below displays the updated point attribute values from the intersecting polygons.

The updated values

Article ID: 000041646

Software:
  • ArcGIS Pro

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options