Merge polygons While keeping all Related management records?

307
3
Jump to solution
04-09-2024 01:48 PM
ODWC_GIS
New Contributor III

I have a Feature Class of polygons which represent an Area of Conservation.  Field Staff at my agency can record individual management practices visited upon any Area via a related table of Management Records.

  • Area of Conservation is a Polygon with a GlobalID
  • Management Table is related to the Area of Conservation (latter's GLOBALID is the table's foreign key)

I don't know how or when it happened, but it appears that some of the Areas have been duplicated.

The Management Records have been attached to the Areas seemingly at random.

Area "D" has 2 polygons that are identical, but each has its own GLOBALID.
Management Records for "D" have been attached to both of the current polygons.

I tried merging the two instances of "D," but that results in the loss of all Management Records without the preserved record's GLOBALID.  (Created a new Version, and tried it there. Then deleted that Version.)

Merging two features (update one, delete the other) results in the non-dominant feature(s) related records to be deletedMerging two features (update one, delete the other) results in the non-dominant feature(s) related records to be deleted

I'd want to merge the duplicate polygons, but keep all the Management Records as belonging to the resulting Area.

Has anyone encountered a similar issue, and created a solution?

Is it possible to somehow merge identical polygons in a Feature Class, such that the Related Records Table keeps everything (or somehow updates the related GLOBALIDs used)?

Didn't databases used to have that kind of a setting somewhere?  The changes would flow downhill from parent tables?  

I have found the settings for the "Relationship Class Split Policy," but I have yet to stumble upon anything for Merges.  Is there a simple solution with which I am unfamiliar?

0 Kudos
1 Solution

Accepted Solutions
ODWC_GIS
New Contributor III

I did not find a polished solution to this issue.  So I brute-forced it.

To make it a bit easier on myself I made a new map and layered the Troubling Polygon Layer atop a Map Image Layer derived from the same service, with the former displayed with Difference Layer Blend and Hard Light Feature Blend.  Resulted in stacked polygons showing up as a nice bright blue, and single polygons looking like a grey/purple block.  Red is a different situation.

HbF_anno.PNG

Also, if you export a copy of your feature class alongside a copy of its table, you can join the latter to the former based on a double or float field ... like Acres... and then Select by Attributes all those records whose GLOBALID from the feature class doesn't match the GLOBALID from the table.  It made searching for duplicates a lot easier.

But be warned, you may find other errors in your datasets, as did I.

Brute forcing it was simple-ish...  

  1. Select a Stack of Troubling Polygons, Select the Related Data.
  2. Copy the GLOBALIDRE in the Related Management Records which matches the earliest polygon's GLOBALID, and use it to replace any Management Record whose GLOBALIDRE value is anything else.
  3. Then update the now-singly referenced Polygon's fields to reflect the most recently-edited polygon-duplicate.
  4. Finally, delete the duplicate polygons that now have no business remaining in the database.

 

It was a slog. 

 

I don't wish this on anybody, and I can only be glad that it was just those hundred-ish plots affected.

 

View solution in original post

3 Replies
Scott_Harris
Esri Regular Contributor

@ODWC_GIS 

How are you performing the Merge? 

If you're using the Merge tool on the Edit > Modify Feature pane, then you can choose which feature to preserve attributes from - so in your case, choose to preserve the one with the globalID that is related to the table.

0 Kudos
ODWC_GIS
New Contributor III

Yup.  But not all of the related records are attached to only one of the duplicated Features.

Take Area "D" ~

ODWC_GIS_0-1712785377723.png

Two identical areas that I'd like to be a single area.

Four Management Records associated with Area "D," but not necessarily with a single feature:

ODWC_GIS_1-1712785501535.png

As I mentioned in my original post, I created a test Version (it's still Traditionally Versioned) to test a Merge.  

Using the Edit > Modify, and selecting the two duplicate features, I instigated the Merge to preserve the earliest polygon.  Doing so deleted any related records associated with the later-created polygon.

Earliest Polygon ID = 23292.  Related Record IDs: 18840, 31220, 31230.
Later Polygon ID = 32515.  Related Record IDs: 26020.
Merging the 2 Polygons in favor of 23292 automatically Deletes Record 26020.

I'd like to find a tool or solution that would assign Record 26020 to the merged Polygon.

The real problem is that the duplicated polygons aren't just doubled.  Nor are the Related Records attached to any particular Feature; it really seems to be random.

...I'm worried I'm just going to have to brute force it: manually editing all the features and table records.

0 Kudos
ODWC_GIS
New Contributor III

I did not find a polished solution to this issue.  So I brute-forced it.

To make it a bit easier on myself I made a new map and layered the Troubling Polygon Layer atop a Map Image Layer derived from the same service, with the former displayed with Difference Layer Blend and Hard Light Feature Blend.  Resulted in stacked polygons showing up as a nice bright blue, and single polygons looking like a grey/purple block.  Red is a different situation.

HbF_anno.PNG

Also, if you export a copy of your feature class alongside a copy of its table, you can join the latter to the former based on a double or float field ... like Acres... and then Select by Attributes all those records whose GLOBALID from the feature class doesn't match the GLOBALID from the table.  It made searching for duplicates a lot easier.

But be warned, you may find other errors in your datasets, as did I.

Brute forcing it was simple-ish...  

  1. Select a Stack of Troubling Polygons, Select the Related Data.
  2. Copy the GLOBALIDRE in the Related Management Records which matches the earliest polygon's GLOBALID, and use it to replace any Management Record whose GLOBALIDRE value is anything else.
  3. Then update the now-singly referenced Polygon's fields to reflect the most recently-edited polygon-duplicate.
  4. Finally, delete the duplicate polygons that now have no business remaining in the database.

 

It was a slog. 

 

I don't wish this on anybody, and I can only be glad that it was just those hundred-ish plots affected.