Hi,
I need to create an add-in that merges two features into one existing one. But the Merge method only offers a merge to a new feature. (Merge Method—ArcGIS Pro).
Which method should I use?
I need basically the same functionality that the Tool -> Merge -> Existing Feature offers in ArcGIS Pro, but with certain conditions (e.g. a smaller area is always merged to a larger one, a shorter line to a longer one, etc.). So I create my own add-in.
Can you please advise me?
Thank you,
Romana Zemankova
Solved! Go to Solution.
Hi,
I would like suggest you workaround I used in my case. I needed to update polygon feature with new geometry, but using EditOperation ConstructPolygons I got few polygons. So after Execute of operation I checked all results, selected one with my criteria, copied shape from new feature and made undo of last operation. After that I created new EditOperation and called Modify and Execute methods
Hi,
I would like suggest you workaround I used in my case. I needed to update polygon feature with new geometry, but using EditOperation ConstructPolygons I got few polygons. So after Execute of operation I checked all results, selected one with my criteria, copied shape from new feature and made undo of last operation. After that I created new EditOperation and called Modify and Execute methods
Hello, thank you very much for your suggestion.
For me, it is essential that the objectID of the element to which the second element is merged is preserved.
So your suggestion is that I merge into a new feature, take the geometry from the new feature, then cancel this operation and modify the original feature with the geometry of merge and delete the second feature?
Seems like correct workflow.
P.s. Don't forget to set SelectNewFeatures flag of EditOperation to true. Only your new feature will be selected after merge execution and you can take new objectid from selection for shape copying
Thank you, I'll try this solution.
Hello,
my final solution is that I made the GeometryEngine.Instance.Union(polygon1, polygon2) operation, and then I changed the geometry of one feature and deleted the second feature. I avoided undo operation.