I'm initializing my rtree with
namespace boostGEO = boost::geometry;
typedef boostGEO::model::point<double, 2, boostGEO::cs::cartesian> point;
typedef boostGEO::model::box<point> box;
typedef std::pair<box, std::pair<int, int>> edgesValue;
boostGEO::index::rtree< edgesValue, boostGEO::index::rstar<16> > tree();
And then i fill it like this
for( int i = 0; i < items.size(); i++ )
{
Item* item = items.at(i);
std::vector<ItemRelation> relations = item->getRelations();
point ps1( item->x, item->y );
Item* relatedItem;
for( int j = 0; j < relations.size(); j++ )
{
relatedItem = relations.at(j);
point ps2( relatedItem->x, relatedItem->y );
box bounds( ps1, ps2 );
edgesTree.insert( std::make_pair( bounds, std::make_pair(item->id, relatedItem->id) ) );
}
}
Item->x and Item->y are doubles and Item->id is Integer. When I run my code I am getting the following error:
/opt/bp/boost_1_58_0/boost/geometry/index/rtree.hpp:1248: 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, 2ul, boost::geometry::cs::cartesian> >, std::pair<int, int> >; Parameters = boost::geometry::index::rstar<16ul>; IndexableGetter = boost::geometry::index::indexable<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian> >, std::pair<int, int> > >; EqualTo = boost::geometry::index::equal_to<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian> >, std::pair<int, int> > >; Allocator = std::allocator<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian> >, std::pair<int, int> > >; boost::geometry::index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator>::value_type = std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2ul, boost::geometry::cs::cartesian> >, std::pair<int, int> >]: Assertion `(detail::is_valid(m_members.translator()(value)))&&("Indexable is invalid")' failed.
Could anyone pls give me a hint what went wrong? I have totally no idea.