Boost logo

Geometry :

Subject: Re: [geometry] Compiling intersection() after registering custom point for use with the model box, ring and polygon
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-05-30 22:16:40


Hi Andrew,

2014-05-31 0:45 GMT+02:00 Andrew Hundt <athundt_at_[hidden]>:

> I was able to create a minimal example that reproduces the error, any
> suggestions on how to correctly register the models would be greatly
> appreciated!
>
>
> #include <boost/geometry.hpp>
>
>
> struct legacy_point
>
> {
>
> double x, y;
>
> };
>
>
> BOOST_GEOMETRY_REGISTER_POINT_2D(legacy_point, double, cs::cartesian, x, y
> )
>
>
>
> int main( int /*argc*/, const char** /*argv*/ ){
>
>
> boost::geometry::model::polygon<legacy_point> poly;
>
> boost::geometry::model::ring<legacy_point> ring;
>
> boost::geometry::model::box<legacy_point> box;
>
>
>
> boost::geometry::intersection(box, ring, poly);
>
> }
>
>
Please don't top post.

The last argument of intersection() should be MultiPolygon in this case,
not Polygon, see:
http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/algorithms/intersection.html

Another thing is that the library should probably inform explicitly what's
wrong.

Regards,
Adam



Geometry list run by mateusz at loskot.net