Hi,
I'm trying to find and fill holes in polygons.
This is how I look for holes:
private async Task EditHole(FeatureLayer polygonLayer, QueryFilter queryFilter)
{
await QueuedTask.Run(() =>
{
var list = new List<Polygon>();
ReadOnlySegmentCollection seg = null;
var polygonFeatureClass = polygonLayer.GetTable() as FeatureClass;
var polygonDefinition = polygonFeatureClass.GetDefinition();
var rowCursor = polygonFeatureClass.Search(queryFilter);
while (rowCursor.MoveNext())
{
using (var lineFeature = rowCursor.Current as Feature)
{
var polygonGeometry = lineFeature.GetShape() as Polygon;
IEnumerator<ReadOnlySegmentCollection> segments = polygonGeometry.Parts.GetEnumerator();
while (segments.MoveNext())
{
//I do not know what to do
}
}
}
});
}
For example, a polygon like this:
Would anyone have an idea or advice on how to do this?
Is there any way to distinguish between the outer and inner polygon?
Thank you for any advice and help
David
the outer ring should be the first part, the inner rings follow for singlepart shapes with holes
or an oft used method is to calculate the area for the bits using the "shoelace formula"... clockwise oriented outer rings yield a negative area and ccw inner rings yield a positive area
When the mentioned selection creates over 180 thousand parts, then I can distinguish external and internal how?
Using Pro tools
Eliminate Polygon Part (Data Management)—ArcGIS Pro | Documentation
But this seems to be a programming language specific question and not an ArcGIS Pro question. Is there an SDK that you want it moved to?
Surely this is a question rather there, how is it moved?
given the proliferation of curly braces, I moved it to the arcgis-api-for-javascript question section.
You choose your Community from the following to get a targeted location
moderators can do the moves
ArcGIS Pro SDK, c # language is not on the menu so it will be the best there
Thank you for helping to make the next move.