Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete holes in a Polygon

Tags:

I have a polygon determined by an Array of Points.

This polygon is crossing itself making some holes in the polygon itself.

My questions is: How can I omit this holes and just get the exterior points of the polygon?

Or what will be the same and probably easier: Which Algorithm for checking if a point is inside a Polygon should I use to detect the points in the holes of the polygon as inside points?

Thanks in advance,

/roger

like image 539
roger Avatar asked Nov 12 '09 12:11

roger


People also ask

How do you fill a hole in a polygon?

on the Production Editing Advanced toolbar. Press the Ctrl key and click inside any of the selected polygons. The Fill Hole message appears and notifies you that all holes in the selected features will be filled.

How do you remove points from a polygon?

Deleting polygon points and shapes While in picking mode, right-click within the polygon and click Delete Shape to delete the selected shape, or click Delete all points from "Polygon" to delete all the polygon shapes and points.

How do you remove gaps between polygons in ArcGIS?

You can inspect the selected polygons to see if they are slivers, then either use the Editor > Merge command or the Eliminate geoprocessing tool (requires an ArcGIS for Desktop Advanced license) to merge the slivers with neighboring polygons.

How do I cut a hole in a polygon in ArcGIS pro?

A hole in a polygon feature is a part of a multipart feature. To create a hole, finish the primary part and sketch the hole. Alternatively, you can split the feature and delete the part, or clip a hole using an existing overlapping feature. These tools are available in the Modify Features pane.


1 Answers

First, find all intersections of edges, add these intersections to the vertices list, and split the edges at these intersections. Then, start with one vertex that is obviously an external one (e.g. the "rightmost") and trace the outline, adding edges and vertices to the result sets. Tracing the outline is simply going along the edge with minimum angle to the last edge.

like image 58
Svante Avatar answered Oct 11 '22 22:10

Svante