Alternative to 'Editors Merge' feature using ArcPy

You could use the arcpy.Geometry() object's .union() method:

>>> g1, g2 = [f[0] for f in arcpy.da.SearchCursor("BufferedPoints","SHAPE@")]
>>> g1
<Polygon object at 0x1929f830[0x1929f920]>
>>> g2
<Polygon object at 0x1929f730[0x1929f440]>
>>> g3 = g1.union(g2)
>>> arcpy.CopyFeatures_management(g3,"in_memory\unionres")
<Result 'in_memory\\unionres'>

Here I have a feature class with two polygons overlapping and after union there is just one.

enter image description here

Now you can use the arcpy.da.UpdateCursor() to delete one of the features (.deleteRow() method) you want to discard and then preserve another one (that you want to keep the attributes of) and update its SHAPE@ with the newly created arcpy.Geometry object.


if the feature that need to be merged have a common attribute value (or if they all need to be merged), then you can use the dissolve tool (exists both in ArcGIS Data management -> Generalization -> Dissolve) and QGIS vector ->geoprocessing tools --> dissolve). In ArcGIS, there is an option to create (or not) multipart polygons. In QGIS you get multipart polygons by default. Note that there is a QGIS plugin if you want more control on your attribute table.

MULTI_PART —Specifies multipart features are allowed. This is the default.

SINGLE_PART —Specifies multipart features are not allowed. Instead of creating multipart features, individual features will be created for each part.