I have discovered that some of the polygons that users are bringing into my system and creating a new object from have self intersections. I need to be able to first detect if a self intersection exists, and if it does then repair it automatically.
Is SimplifyAsFeature the best method to do this with for both detection and fixing?
protected Geometry FixSelfIntersections(Geometry inGeometry)
{
//I want to see if it has self intersections FIRST??
bool isSelfIntersecting = NEED TO FIND FIRST??;
//Fix if it has intersections
if (isSelfIntersecting)
{
inGeometry = GeometryEngine.Instance.SimplifyAsFeature(inGeometry, true);
}
return inGeometry;
}
Solved! Go to Solution.
Hi,
You can use the GeometryEngine.Instance.IsSimpleAsFeature method to determine whether the feature is "simple". (ie does not have self-intersections). If the feature is not simple then you would call GeometryEngine.Instance.SimplifyAsFeature to simplify it.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic15566.html
The Geometry Concepts page has a section describing these two methods
Thanks
Narelle
Hi,
You can use the GeometryEngine.Instance.IsSimpleAsFeature method to determine whether the feature is "simple". (ie does not have self-intersections). If the feature is not simple then you would call GeometryEngine.Instance.SimplifyAsFeature to simplify it.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic15566.html
The Geometry Concepts page has a section describing these two methods
Thanks
Narelle