ITopological operator in Pro Objects SDK

181
3
Jump to solution
11-29-2022 01:55 AM
naveenbesri
Occasional Contributor

Hi @Wolf ,

I need to migrate my one of tool from arcobjects to pro objects which is used to find duplicate vertices. please find the code snippet below.

ITopologicalOperator topo = null;
ITopologicalOperator3 operator3 = null;

if (feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
{
topo = feature.Shape as ITopologicalOperator;
operator3 = topo.Boundary as ITopologicalOperator3;
}
else
operator3 = feature.Shape as ITopologicalOperator3;

esriNonSimpleReasonEnum reasen = esriNonSimpleReasonEnum.esriNonSimpleDuplicateVertex;
operator3.IsKnownSimple_2 = false;

 

Please help me or suggest me on this issue. 

0 Kudos
1 Solution

Accepted Solutions
AnnetteLocke
Esri Contributor

Hi, currently we don't return a reason from the simplify operator, but we do have a backlog issue for it. I have changed it to a high priority item, so it will go into ArcGIS Pro SDK 3.2. In the meantime, if you call GeometryEngine.SimplifyAsFeature, the duplicate vertices will be removed. If that's not what you want, then call GeometryEngine.IsSimpleAsFeature. If false is returned, you can loop through the vertices to find the duplicates. 

View solution in original post

3 Replies
AnnetteLocke
Esri Contributor

Hi, currently we don't return a reason from the simplify operator, but we do have a backlog issue for it. I have changed it to a high priority item, so it will go into ArcGIS Pro SDK 3.2. In the meantime, if you call GeometryEngine.SimplifyAsFeature, the duplicate vertices will be removed. If that's not what you want, then call GeometryEngine.IsSimpleAsFeature. If false is returned, you can loop through the vertices to find the duplicates. 

naveenbesri
Occasional Contributor

Hi Annette,

Thanks for the information which you have provided will definitely try GeometryEngine.IsSimpleAsFeature and let you know and meanwhile does this works with Simpleselfinterection as well?  because in my tool I am covering three validations listed below which is used for migrating the data  into UN data model. As UN doesnt allow this errors while loading the data. which we will report these errors to  our customer.   

1. Find duplicate vertices on polylines.

2. Find self intersection on Polygons.

3. Find duplicate features on points. 

 

Kindly help me out on this.

 

 

0 Kudos
AnnetteLocke
Esri Contributor

Yes, it works with all the cases that you mention. There is more information here: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geometry#simplifyasfeature-and-issimpleasfea... 

0 Kudos