Allow updating geometry in Field Calculator

520
2
07-27-2016 09:39 AM
Status: Closed
Labels (1)
GreggRoemhildt1
Occasional Contributor

Lets say I have two feature class,

 

- Points A. All the points have a unique point_id.

- Points B, these points have an ID that matches the point_id in the Points A class.

 

I can join these two tables using the point_id.

 

Now I would like to update the geometry of the points A feature class with the geometry with points B. This would be trivial in an SQL server...It would be very useful in ArcGIS file geodatabases.

 

    UPDATE Point_A a
    INNER JOIN Point_B
    ON a.point_id=b.point_id
    SET A.geom=B.geom;

 

Perhaps this could apply to any type of geometry also.

2 Comments
AnthonyClark3

This be done using Python. You can do an arcpy.da.UpdateCursor (point a) and store the point_id as a variable. Then nest an arcpy.da.SearchCursor on the second feature class (point b), with an if statement.

If point_id1 == point_id2:

    geometery1 = geometry2

Here's the link to UpdateCursor. And note, "Geometry properties can be accessed by specifying the token SHAPE@ in the list of fields."

UpdateCursor—Help | ArcGIS for Desktop

DrewFlater
Status changed to: Closed

The workflow described can be accomplished starting in Pro 3.1, but not using the Calculate Field tool. The Append tool has a new geometry update mode and parameters to configure how the update should be made. This was covered in this newer Idea: https://community.esri.com/t5/arcgis-pro-ideas/gp-tool-to-batch-replace-geometries-from-one-fc-to/id...

DrewFlater_0-1672770303061.png