I'm using
BOOST_GEOMETRY_REGISTER_POINT_3D(glm::vec3, float, boost::geometry::cs::cartesian, x, y, z);
with an RTree defined as:
using IndexedPoint = std::pair<glm::vec3, uint32_t>;
using RTree = boost::geometry::index::rtree<IndexedPoint, boost::geometry::index::rstar<8>>;
When I try to run a nearest neighbor query with this it fails to compile:
auto it = rtree.qbegin(boost::geometry::index::nearest(glm::vec3(), 3))
The error is:
error C2664: 'int boost::mpl::assertion_failed<false>(boost::mpl::assert<false>::type)': cannot convert argument 1 from 'boost::mpl::failed ************(__cdecl boost::geometry::strategy::distance::services::default_strategy<boost::geometry::point_tag,boost::geometry::box_tag,glm::vec<3,float,0>,boost::geometry::model::point<float,3,boost::geometry::cs::cartesian>,boost::geometry::cartesian_tag,boost::geometry::cartesian_tag,void>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE_COMBINATION::* ***********)(boost::mpl::assert_::types<Point1,Point2,CsTag1,CsTag2>)' to 'boost::mpl::assert<false>::type'
with
[
Point1=glm::vec<3,float,0>,
Point2=boost::geometry::model::point<float,3,boost::geometry::cs::cartesian>,
CsTag1=boost::geometry::cartesian_tag,
CsTag2=boost::geometry::cartesian_tag
]
It seems comparable_distance_result is missing specializations for vec3 vs boost::geometry::model::point and boost::geometry::model::box. I have tried adding them manually, but couldn't make it work. How can I add the required distance type specializations?
Note that I can use the same setup for spatial queries just fine, so it seems basically sound.