GP tool to batch-replace geometries from one FC to another (via related IDs)

1878
7
02-01-2022 12:18 PM
Status: Implemented
Labels (1)
Bud
by
Notable Contributor

It would be helpful if there were a out-of-box GP tool that could  batch-replace geometries from one FC to another — via a tabular relationship.

Example:

  • I have a polyline FC called FC-A.
  • And I have an additional polyline FC called FC-B.

I want to update the shapes in FC-A with the shapes from FC-B.

  • I want to update the existing SHAPE values, without replacing the FC or replacing the records.
  • The link between the two FCs is a tabular ID field.


Currently, I don't think there are any tools that can do that.

 

7 Comments
DrewFlater
Status changed to: In Product Plan

The Append tool will do this in Pro 3.1 using addition Update parameters.

DrewFlater_0-1672770004693.png

 

DrewFlater

@Bud We had the Upsert development project in our backlog for awhile and were gathering requirements and researching how the capability could be applied to the Append tool. Seeing your Idea about a year ago, we thought it could be satisfied by the Append tool enhancement. So yes, this Idea pushed us in the direction of doing the Upsert development work in 3.1. There are always many factors at play when it comes to prioritizing our development work, and Ideas are a critical way we can work on and deliver capabilities requested by the user community. So keep up your Ideas and I'm sure more will be implemented in future releases.

Bud
by

@DrewFlater 

In scenarios where the user only wants to update existing rows, not insert new ones, how does Esri recommend we do that? For example, how to only select rows in FC-B that already exist in FC-A when upserting?
Use an SQL subquery in the expression parameter to only select rows from FC-B that already exist in FC-A? Or something else?

Also, what happens if there are duplicates in FC-B, but no duplicates in FC-A? What row from FC-B will be used to update the row in FC-A?

DrewFlater

@Bud for scenarios which are updated existing, I suggest to use Add Join with the option to only keep matching records, then Calculate Field to calculate the target fields to get the values from the join fields (whichever fields you want). This is done internally as a sort of pre-process within the upsert option of Append, so the same strategy will work well. If there are duplicates in FC-B it will make a 1:m join. 

AmeliaBradshaw
Status changed to: Implemented

This Idea has been implemented in ArcGIS Pro 3.1 as an upsert option. The blog Upsert your datasets using the Append tool in ArcGIS Pro 3.1 goes into this functionality in more detail.  Please see the What's New documentation for more new features in Pro 3.1.

The Ideas in ArcGIS Pro 3.1 blog will be wrapped up soon. Once complete, I will add the link to this comment.

Bud
by

@DrewFlater (and @DanLee)

As mentioned in a different post, the reason this can't be done using the Field Calculator is:

When we join to a different FC, the SHAPE column from that FC doesn't get brought in as a joined field. So, it's not a valid input.

Out of curiosity, when joining to a different FC, why doesn't ArcGIS Pro bring in the SHAPE column as one of the joined columns?

I understand that having multiple geometry columns in the attribute table, map, etc. could be problematic. So the joined SHAPE could be ignored in mechanisms like that. But why not make the Field Calculator be the exception? Make the joined SHAPE only be visible to the Field Calculator, Select by Attributes, etc.

That way, we could use the joined SHAPE for analysis purposes (not just just for batch-replacing SHAPEs, which is what the Append tool can be used for).

For example, use the vertices (or a subset of the vertices/dimensions) from the joined SHAPE to construct a new/different SHAPE.

DanLee
by Esri Regular Contributor
Bud, you said: 
For example, use the vertices (or a subset of the vertices/dimensions) from the joined SHAPE to construct a new/different SHAPE.
Could you describe why you need to do this with some screenshots of the two sets of data? Since there is a common link (ID field as you said) between the two datasets, could you use Feature Vertices To Points tool to get the vertices for your FC-B, which carries the input feature ID in ORIG_FID field and the common ID field, you can then use the points to construct what you need?
 
On a different thought, if you like the geometry of your FC-B, would you consider using Join Field to transfer attributes from FC-A to FC-B via the common ID?