#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/extensions/index/rtree/rtree.hpp>
namespace bg = boost::geometry;
typedef bg::model::d2::point_xy<double> point;
typedef bg::model::box<point > envelope;
int main (int argc, char const *argv[])
{
bg::index::rtree<envelope, std::size_t> si(1, 6);
point p1(1,1);
point p2(4,4);
point p3(3,3);
point p4(6,6);
const envelope e1(p1,p2);
const envelope e2(p3,p4);
const std::size_t e2i = 44;
si.insert(e2, e2i); // The compilation error is not triggered if this line is commented
return 0;
}
OUTPUT :
$ g++ -Wall -I/opt/local/include/ -I../libs/boost-geometry-0.9.0 -c ggl.cpp -o obj/ggl.o
../libs/boost-geometry-0.9.0/boost/geometry/strategies/area.hpp: In instantiation of ‘boost::geometry::strategy::area::services::default_strategy<boost::geometry::cartesian_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >’:
../libs/boost-geometry-0.9.0/boost/geometry/strategies/area_result.hpp:40: instantiated from ‘boost::geometry::area_result<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> > >’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:473: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::split_node(const boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&, boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&, boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&) const [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:262: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::insert(const Box&, const Value&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
ggl.cpp:25: instantiated from here
../libs/boost-geometry-0.9.0/boost/geometry/strategies/area.hpp:32: error: no matching function for call to ‘assertion_failed(mpl_::failed************ (boost::geometry::strategy::area::services::default_strategy<boost::geometry::cartesian_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::************)(mpl_::assert_::types<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian>, mpl_::na, mpl_::na, mpl_::na>))’
../libs/boost-geometry-0.9.0/boost/geometry/strategies/area_result.hpp: In instantiation of ‘boost::geometry::area_result<boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> > >’:
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:473: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::split_node(const boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&, boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&, boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&) const [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:262: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::insert(const Box&, const Value&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
ggl.cpp:25: instantiated from here
../libs/boost-geometry-0.9.0/boost/geometry/strategies/area_result.hpp:40: error: no type named ‘type’ in ‘struct boost::geometry::strategy::area::services::default_strategy<boost::geometry::cartesian_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >’
../libs/boost-geometry-0.9.0/boost/geometry/strategies/area_result.hpp:42: error: no type named ‘type’ in ‘struct boost::geometry::strategy::area::services::default_strategy<boost::geometry::cartesian_tag, boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp: In member function ‘void boost::geometry::index::rtree<Box, Value>::split_node(const boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&, boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&, boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> >&) const [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’:
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:262: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::insert(const Box&, const Value&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
ggl.cpp:25: instantiated from here
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:473: error: no matching function for call to ‘area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:474: error: no matching function for call to ‘area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:475: error: no matching function for call to ‘compute_union_area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&, const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:476: error: no matching function for call to ‘compute_union_area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&, const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:262: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::insert(const Box&, const Value&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
ggl.cpp:25: instantiated from here
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:549: error: no matching function for call to ‘area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:550: error: no matching function for call to ‘area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:552: error: no matching function for call to ‘compute_union_area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&, const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:553: error: no matching function for call to ‘compute_union_area(boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&, const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp: In member function ‘boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> > boost::geometry::index::rtree_node<Box, Value>::choose_node(const Box&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’:
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:733: instantiated from ‘boost::shared_ptr<boost::geometry::index::rtree_node<Box, Value> > boost::geometry::index::rtree<Box, Value>::choose_corresponding_leaf(const Box&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree.hpp:251: instantiated from ‘void boost::geometry::index::rtree<Box, Value>::insert(const Box&, const Value&) [with Box = boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >, Value = long unsigned int]’
ggl.cpp:25: instantiated from here
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp:304: error: no matching function for call to ‘area(const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp:304: error: no matching function for call to ‘compute_union_area(const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&, const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp:310: error: no matching function for call to ‘area(const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp:320: error: no matching function for call to ‘area(const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp:327: error: no matching function for call to ‘area(const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/extensions/index/rtree/rtree_node.hpp:330: error: no matching function for call to ‘area(const boost::geometry::model::box<boost::geometry::model::d2::point_xy<double, boost::geometry::cs::cartesian> >&)’
../libs/boost-geometry-0.9.0/boost/geometry/util/math.hpp: At global scope:
../libs/boost-geometry-0.9.0/boost/geometry/util/math.hpp:101: warning: ‘boost::geometry::math::r2d’ defined but not used