-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi,
currently if you try to add a 2D Geometry to the core with an active SpatialIndex module you will receive following runtime error from the Boost rtree:
[ctest] sempr_spatial_conclusion_tests: /usr/include/boost/geometry/index/rtree.hpp:1445: void boost::geometry::index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator>::raw_insert(const value_type&) [with Value = std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian> >, std::shared_ptr<sempr::entity::Geometry> >; Parameters = boost::geometry::index::quadratic<16ul>; IndexableGetter = boost::geometry::index::indexable<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian> >, std::shared_ptr<sempr::entity::Geometry> > >; EqualTo = boost::geometry::index::equal_to<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian> >, std::shared_ptr<sempr::entity::Geometry> > >; Allocator = std::allocator<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian> >, std::shared_ptr<sempr::entity::Geometry> > >; boost::geometry::index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator>::value_type = std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 3ul, boost::geometry::cs::cartesian> >, std::shared_ptr<sempr::entity::Geometry> >]: Assertion(detail::is_valid(m_members.translator()(value)))&&("Indexable is invalid")' failed.
`
The reason for this is, that geos::geom coordinates stores X, Y, NaN for 2D coordinate and the boost rtree expect valid 3D points without a NaN value.
So how to handle 2D and 3D in the same context? ( set z to 0 instead of NaN)?