3

I am currently working with two different feature classes in ArcGIS Pro, and I would like to know how to replace the geometry of one feature with another feature's geometry when all fields are different between the two feature classes.

For example, I have two feature classes:

Feature class A contains features A1, A2, A3, A4, and A5. Feature class B contains features B1, B2, B3, B4, and B5. I would like to replace the geometry of feature B1 with the geometry of feature A1 while keeping all the attributes of feature B1 intact.

Is there a straightforward tool or process in ArcGIS Pro that can help me accomplish this?

I have searched for a solution in the documentation and online resources but have not yet found a clear answer.

3
  • You can do it one by one in attribute transfer dialog. There is an option replace geometry or similar. Way easier is to create common field, join and delete unwanted fields.
    – FelixIP
    Apr 5, 2023 at 1:20
  • 1
    Is there a 1-to-1 relationship between the features in the two feature classes, such that you want to update all features in the 'B' feature classes? Or is the relationship between the two feature classes not as simple as that, and not every feature needs updating, or there is not a simple relationship between the two feature classes? Apr 6, 2023 at 0:43
  • This works well. Is there a way to automate this in Python? I tried calculating Shape for every row at once, but it crashes Pro. I discovered I have to have the same records selected in the new and old tables with matching Facility ID when I run this code, or it won't transfer the correct geometry from the old to new table.
    – Levi Cecil
    Aug 2, 2023 at 15:25

2 Answers 2

3

To perform this operation one at a time, use the 'Transfer Attributes' option in the 'Modify Features' pane, setting the field mapping to include ONLY the 'Shape' field. (Note that this is similar, but not quite the same as the 'Transfer Attributes' tool.)

Set Up:

  • 'Edit' tab (in the ribbon)
  • 'Modify' item (in the Edit tab)
  • 'Transfer Attributes' item (in the Modify Features pane)
  • Click the 3 horizontal bars (hamburger menu) item
  • Choose 'Field Mapping'
  • Select the 'Target' layer AND the 'Source' layer at the top of the field mapping
  • Click 'Clear' (to delete all items in the field mapping - THIS IS IMPORTANT - otherwise you'll also replace any other mapped attributes)
  • Next to the 'Shape' field, click the blank space and select 'Shape' for the source field
  • Click 'OK'

Now you're all set up and ready to go.

Perform Updates:

  • Click on a source feature (eg, 'A1') then click on a target feature (eg, 'B1'). The target feature's geometry will be replaced.

  • Repeat for each other source/target pair of features.

Note that this process can sometimes be a little tricky. I find that turning off all other layers helps a lot. Sometimes it is necessary to turn off the target layer while selecting the source feature, and vise versa.

1
  • This worked first-try-no-warm-up and was exactly what I was looking for. Many thanks. Apr 6, 2023 at 18:33
3

Simplest way is create common field, join 2 tables and remove unnecessary fields. Alternative is to use tiny field calculator expression on field Shape of feature class with wrong geometry:

G = arcpy.Geometry()
geomList = arcpy.management.CopyFeatures("CORRECT_GEOMETRY",G)
def replaceGeometry():
  return geomList[0]
#------
replaceGeometry()

So start editing FC with wrong geometry:

enter image description here

Select one (!!!) feature in A and B:

enter image description here

Run script:

enter image description here

You can re-run it from Results window, just remember selection rule:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.