Boost logo

Geometry :

Subject: Re: [geometry] Fwd: Some updates
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-08-04 11:25:06


Menelaos Karavelas wrote:
> On 04/08/2014 05:14 ??, Andrew Hundt wrote:
>> As usual, it is really too bad the documentation for boost is so
>> terrible. I would probably like it a lot more if it had reasonable
>> documentation. Just getting to the above point, figuring out things
>> like how to even get the points out of a multi_polygon has taken me
>> hours, and I have no idea why simplify just makes everything size zero.
> If you just want to "see on the screen" the multipolygon you can
> always use boost::geometry::wkt.

Or svg_mapper

MultiPolygon is a Range of Polygons

To access Polygon's Rings you can use:
- bg::exterior_ring() -
- bg::interior_ring() -
namespace bg = boost::geometry;

Ring is a Range of Points

So e.g. to get the first Point of an exterior ring you can use (assuming
that the Geometries aren't empty):

// generic version
*boost::begin( bg::exterior_ring( *boost::begin(multi_poly) ) )

// non-generic version working ONLY for bg::multi_polygon and bg::polygon

Yes, I agree that the documentation could be improved. If you have some
ideas and willing to help don't hesitate to propose improvements (fixes,
examples, better descriptions, etc.), ask questions about them (e.g.
where exactly they should be added) and/or create a pull request on
GitHub (


Geometry list run by mateusz at