Hello,
I am currently writing functionality with the ArcGIS Pro SDK part of which will be used to split polygon features. To do the split, I am using an EditOperation and calling the method Split(Layer, ObjectID, Geometry). When attempting this on a polygon layer, I am seeing an exception thrown that says "Only polyline layers can be split". This is interesting, because polygon splits are possible through the ArcGIS Pro editing interface.
Does the ArcGIS Pro SDK not support splitting polygon features? Or if it does, is there another way I would be able to do the split with the SDK?
Thanks in advance,
Greg
Solved! Go to Solution.
Hi Greg,
Use the Cut method on EditOperation to cut polygon features with a split geometry.
This is being deprecated at 2.3 in favor of the Split method which will have more overloads for polygons and splitting by features.
Hi Greg,
Use the Cut method on EditOperation to cut polygon features with a split geometry.
This is being deprecated at 2.3 in favor of the Split method which will have more overloads for polygons and splitting by features.
Good to know, thank you!
Sean,
In the sdk pro concepts it has an example to cut still https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing. Will this example still work in 2.3 +.
The second example shows Clip, Cut, and Planarize edits on a single feature also combined into a single edit operation:
//Multiple operations can be performed by a single //edit operation. var op = new EditOperation(); op.Name = "Clip, Cut, and Planarize Features"; //Combine three operations, one after the other... op.Clip(featureLayer, oid, clipPoly); op.Cut(featureLayer, oid, cutLine); op.Planarize(featureLayer, new List<long>() { oid}); //Execute them all together await op.ExecuteAsync(); if (!op.IsSucceeded) { //TODO: get the op.ErrorMessage, inform the user }
Matthew,
The Cut methods will work in 2.3+ until we can make a breaking change to the API and remove them at 3.0.
You can find examples for the newer Split methods at:
2.4 https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Editing