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-06-02 16:06:14

Hi Andrew,

2014-06-02 20:01 GMT+02:00 Andrew Hundt <athundt_at_[hidden]>:

> 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]>:
>>> 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!

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

To compile it I was forced to add some missing headers. Sorry that I didn't
write it in the last email. The following code compiles for me (using
Boost.Geometry develop branch) on Linux GCC 4.8 and Clang 3.4:

#include <boost/geometry.hpp>
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
#include <boost/geometry/geometries/register/point.hpp>

struct legacy_point

    double x, y;


BOOST_GEOMETRY_REGISTER_POINT_2D(legacy_point, double,
boost::geometry::cs::cartesian, x, y)

int main()
   boost::geometry::model::box<legacy_point> box;
   boost::geometry::model::ring<legacy_point> ring;
boost::geometry::model::polygon<legacy_point> > mpoly;

   boost::geometry::intersection(box, ring, mpoly);


If case the above doesn't help, please write which compiler do you use and
which Boost version?


Geometry list run by mateusz at