Boost logo

Geometry :

Subject: Re: [geometry] Compiling intersection() after registering custom point for use with the model box, ring and polygon
From: Andrew Hundt (athundt_at_[hidden])
Date: 2014-06-02 14:01:49


On Friday, May 30, 2014, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]> wrote:

> Hi Andrew,
>
> 2014-05-31 0:45 GMT+02:00 Andrew Hundt <athundt_at_[hidden]
> <javascript:_e(%7B%7D,'cvml','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.
>

Sorry, didn't seem like top posting since I had inline replies in the other
portion.

> 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
>
>

I just tried this with exactly the same code except declaring multi_polygon
instead of polygon and it too didn't compile.

Lots is asserts on not implemented for this geometry type. However the
types are ring box and multipoly so I'm not sure why.

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

> Regards,
> Adam
>

-- 
Cheers!
Andrew Hundt


Geometry list run by mateusz at loskot.net