Boost logo

Geometry :

Subject: [ggl] rtree query expression
From: Adam Wulkiewicz (adam.wulkiewicz)
Date: 2011-08-25 21:05:41


Adam Wulkiewicz wrote:
> Simonson, Lucanus J wrote:
>> and get the expected behavior out of the tree for the simplest cases
>> with the simplest code? This could extend to tuples but there is the
>> slight problem that tuple stores a copy of each element, while
>> intersects<> could store a reference and make light weight use of the
>> geometry. Perhaps we would require that tuple not include bare
>> geometry elements, or just document that doing so incurs a performance
>> penalty due to extra copying.
>
> This sounds good. The user may just use boost::cref(). Or we may have
> other version of make_tuple() e.g. make_cref_tuple().

One remark. Functions

index::XXX(Geometry const&)

will return wrapper

index::detail::XXX<Geometry>

containing Geometry const&

so tuple will contain wrappers with references and the query will look
like this:

result = index::query(
   tree,
   boost::make_tuple(
     index::intersects(g1),
     index::within(g2),
     index::covered_by(g3)
   )
)

Regards,
Adam


Geometry list run by mateusz at loskot.net