[GIS] Merge Spatially Coincident Features in the Same Feature Class

arcgis-10.1arcgis-desktoparcpycoincidentmerge

I need a way to programatically merge grid cells (polygon 15x15m) that are directly on top of each other and add together some of their attributes.

I am working in ArcGIS 10.1 with the data stored as a polygon feature class.

The data is the result of pedestrian survey across a pre-defined grid. On occasion the folks conducting the pedestrian survey get off course and record something in a column or row adjacent to the one they are working in (or the GPS position wanders). This results in two sets of data being recorded for each cell when the data from multiple GPS units are appended into a single feature class. I need a way to go through each cell, check to see if there are any duplicate features, if there are then merge their attributes (some integer, some text), and then delete the one feature that didn't get the merged data.

The 'Delete Identical' and 'Find Identical' tools don't do what I'm looking for – and doing it manually isn't an option as the feature class often has upwards of 10,000 features in it.

I know how to iterate through the feature class using python and check to determine if there are any duplicate features in that location. What I don't know how to do is deal with merging the features and updating the attributes. If anyone can offer some direction on how to accomplish this I would greatly appreciate it.

EDIT – More Description of Before/After State:
In the picture below there are two features selected – identical 15×15 meter square polygons, I need to add together all the integer fields (the ones with TOT_ as a prefix) and append the GPS_UNIT, INITIALS, and REC_DATE string fields.

It's difficult to show since the features directly overlap.

enter image description here

EDIT 2:
I have found that I can easily identify the duplicated features by calculating their XY centers, concatenating them into a string field as [X] & ',' & [Y] then opening the database in access and using a Find Duplicates query to identify which of the cells have been duplicated. I have not however, been able to figure out a good way to merge the attributes for each of the cells into a single row. Help with how to do that, either in python or in a database environment, would be very welcome!

Best Answer

Since you know how to iterate and find the features that you want to merge, I would build a function to do the merge which could probably be arcpy.Dissovle_management(). Do the dissolve and you can probably use the aggregating parameters to combine the attributes then delete those features from the original and update the data back with a insert cursor.

How do you identify which features need to get merged?

Related Question