Boost logo

Geometry :

Subject: [ggl] Understanding get_turns for linestring/polygon overlay
From: John Swensen (jpswensen)
Date: 2011-02-01 10:25:38


I apologize if this email seems rudimentary. I am just getting into both Boost and Boost.Geometry. From the mailing list, I have gleaned that LineString/Polygon boolean operations are not implemented yet. So, I am trying to implement it myself from some of the examples. I am able to successfully create a polygon and a linestring and follow the overlay example to get the list of turn points describing where they intersect. However, I would like to take the list of turn points and create two new polygons from that are divided by the turn points. So my questions are:
1) Is there a way to insert the turn point into the outer ring easily?
2) Is there a way to find the line segments of the outer ring that are divided by the turn points?

If either of these are easy to find, then splitting my polygon into two polygons should be straightforward. I'm just not sure if there is a "right" way to do this. I could always go back and walk my way around the outer ring doing the computation to see of the turn point lies on the line segment and then splitting accordingly, but want to know if this is already implemented and I just can't find it.

John Swensen


Geometry list run by mateusz at loskot.net