Ability to split polygon features with ArcGIS Pro SDK?

896
4
Jump to solution
11-27-2018 12:34 PM
GregSmith2
New Contributor III

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

0 Kudos
1 Solution

Accepted Solutions
SeanJones
Esri Regular Contributor

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.

View solution in original post

4 Replies
SeanJones
Esri Regular Contributor

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.

GregSmith2
New Contributor III

Good to know, thank you!

0 Kudos
MatthewDriscoll
MVP Regular Contributor

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
   }
0 Kudos
SeanJones
Esri Regular Contributor

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.3 https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Editing/c7390062341b3af98291c61a8d5846be1fad...

2.4 https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Editing

0 Kudos