
Geometry : 
Subject: Re: [geometry] Rtree changes
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 20130218 12:16:29
Mateusz Loskot wrote:
> On 18 February 2013 16:35, Mats Taraldsvik <mats.taraldsvik_at_[hidden]> wrote:
>>
>>  Will it be possible to use rtree queries on external (indexable) objects?
>> For example, if I have a rtreeindexed boundary, and a set of notindexed
>> objects, and want to check if the objects intersect with my boundary.
>> Essentially a kind of prepared query like the PreparedGeometry in GEOS.
>
> Assuming geos::geom:: types are adapted as boost::geometry models,
> I'd expect it should be possible. But, I'm also curious Adam's opinion here.
Spatial predicates which may be passed to the query may take arbitrary
Geometry type. To compile properly there must be an algorithm, e.g.
geometry::intersects() which is able to calculate the result for
Indexable and Geometry. So for example it's possible to query for Values
intersecting MultiPolygon. If you store border segments in the rtree
e.g. as std::pair<SegmentBox, SegmentId> and define MultiPolygon
containing other geometries it should return intersected Values. Does it
meet your requirements?
Additionally, if new Geometries were added to the Boost.Geometry and
algorithms implemented for them the rtree should automatically work for
them.
For example, it should be possible to add some CompoundGeometry or
IndexedGeometry concept which stores some number of Geometries and a
SpatialIndex inside (or just the SpatialIndex) and implement
geometry::intersects(Box, CompoundGeometry) which uses this stored
internally SpatialIndex to calculate the result. And this should
automatically work in the rtree.
In the docs there are some basic examples of geometries for which query
may be performed:
Regards,
Adam
Geometry list run by mateusz at loskot.net