Boost logo

Geometry :

Subject: Re: [geometry] R-tree segment query optimization
From: Jeremy Murphy (jeremy.william.murphy_at_[hidden])
Date: 2018-04-23 15:37:50

Hi Adam,

On 11 April 2018 at 10:34, Adam Wulkiewicz via Geometry <
geometry_at_[hidden]> wrote:

> Hi Jeremy,
> No, you can pass your segment to existing spatial predicate as usual. E.g.
> if you pass bgi::intersects(my_segment) into rtree::query() then internally
> bg::intersects(node_box, my_segment) and bg::intersects(point_value,
> my_segment) is called. So after overloading bg::intersects() the rtree
> should just work automatically. Something like this:
I ended up implementing a hemisphere geometry, because I realized that I
only need to search in that finite area.

namespace boost { namespace geometry {
> template <typename Point>
> inline bool intersects(Point const& p, segment_side_region const& s)
> {
> return s.intersects_point(p);
> }
> template <typename Box>
> inline bool intersects(Box const& b, segment_side_region const& s)
> {
> return s.intersects_box(b);
> }
> }}

So I implemented these, but then using them with the rtree is not 'simply'
working. :)

> // and then simply
> segment_side_region region{p0, p1, segment_side_region::right};
> some_segment_type segment{p0, p1};
> rtree.query(bgi::intersects(region) && bgi::nearest(segment, 5), result);

 At this point the hemisphere geometry fails a concept check on this line
from intersects():

.../boost/mpl/assert.hpp:440:42: error: no matching function for call to
void, void, mpl_::na>))’

I have put the geometry in bg::model and given it a tag.
The next error seems meaningful, so I'll include it:

.../boost/geometry/algorithms/detail/disjoint/interface.hpp:65:21: error:
‘value’ is not a member of
2ul, boost::geometry::cs::cartesian> > >’

How do I satisfy these kind of requirements?

Geometry list run by mateusz at