Why are self intersecting polygons bad in geometry?
Thus if you try to fill a polygon or determine its neighboring polygon, the algorithm gets confused when a loop is present, and it will fill or indicate the wrong polygon. This is why most software reports this situation as being invalid.
Why are the polygons on the left and right of the list?
The list still shows polygon 1 being on the left and polygon 2 being on the right, even though that is not the case within the loop. Thus if you try to fill a polygon or determine its neighboring polygon, the algorithm gets confused when a loop is present, and it will fill or indicate the wrong polygon.
How are line segments used to determine polygons?
A polygon is usually made up of multiple line segments. A list showing which polygon is on the left and right of each segment is used to determine which polygon is which. Each segment has only one entry in this list. Suppose you have a line segment which goes from point A to point B.
Is it OK to move a polygon with a point intersection?
If point intersections are not allowed, move one of them a small amount. In my experience, most such intersections some from a faulty polygon simplification, so it would be better to go back to the source if possible. Self-intersected polygon is invalid.
Why are polygon 1 and 2 on the left side of the list?
When you go from A to B, polygon 1 is on the left, and polygon 2 is on the right. If that line crosses over itself to form a loop, then the left and right polygons get reversed for the portion within the loop. The list still shows polygon 1 being on the left and polygon 2 being on the right, even though that is not the case within the loop.
What’s the best way to repair a polygon?
You can repair a polygon using the geos::operation::buffer::BufferOp class. E.g. You can find some more good recipes in the Secrets of the JTS Topology Suite. where points 3 and 6 are the same. If point intersections are not allowed, move one of them a small amount.