I'm trying to use intersection(box,ring,polygon); in 2D, but I'm getting compiler errors that I think are tied to registration. I'm using a boost::geometry::model::* for the box, ring and polygon in this call with a custom coordinate type. I had assumed that models for box, ring, and polygon don't need to be registered. Perhaps that is not correct?


The coordinate is defined as follows:

template<size_t Dim, typename T, typename U = T>

struct Coordinate;


I register the tag, dimension, coordinate_type, and coordinate_system, but I think the most relevant component tied to this error is when I register the coordinate's 'get()' and 'set()' functions as follows (apologies if the email client messes with spacing):


template<size_t Dim, typename T, typename U, size_t Index, typename Enable> 

struct access<Coordinate<Dim,T,U> , Index, Enable>

{

        static inline typename Coordinate<Dim,T,U>::value_type get(Coordinate<Dim,T,U>  const& p) { return p.operator[](Index); }

        static inline void set(Coordinate<Dim,T,U> & p, typename Coordinate<Dim,T,U>::value_type const& value) { p.operator[](Index) = value; }

};


Here is the error:

/usr/local/include/boost/geometry/core/access.hpp:393:24: No member named 'set' in 'boost::geometry::core_dispatch::indexed_access<boost::geometry::polygon_tag, boost::geometry::model::polygon<Coordinate<2, int, Coordinate<2, int, DynamicCellSize<2, Coordinate<2, double, double>, int> > >, true, true, std::vector, std::vector, std::allocator, std::allocator>, int, 0, 0, boost::integral_constant<bool, false> >'



Can anyone provide advice on what steps I need to take to make sure the intersection call will compile correctly?


Thanks in advance.


Cheers!

Andrew Hundt