Boost logo

Geometry :

Subject: [ggl] spacial index
From: Adam Wulkiewicz (adam.wulkiewicz)
Date: 2011-03-28 13:00:59


Barend Gehrels wrote:
> Hi Bruno, Adam,
>
>
> About this:
>
>> One point I wanted to raise before but I thought there was enough
>> discussions to address already. It might surprise you, but I think you
>> shouldn't propose the user to choose which box type your tree should
>> use internally. I.e. the Box template argument shouldn't exist at all.
>
>
>> This is an implementation detail, which has only to do with the guts
>> of your tree. It should be up to you to decide what's the optimal
>> choice, and it doesn't seem to me that the optimal choice depends on
>> any user-specific context. And it doesn't interact at all with the
>> types used by the user. So what's the real justification behind that?
>
>
> I agree about the Box template argument itself, but there should be
> something known (either now or in the future) to the index:
> - the coordinate type
> - the number of dimensions
> - the coordinate system
>
>
> All of them can be derived from the Box template argument.
>
> But it does not have to be a Box, because the index can indeed use its
> own box structure.
>
> One option: having a Geometry there. The index can then easily get the
> point type out of it, and construct an own box type from that point
> type. And all the properties are set. Besides that it might be natural /
> intuitive (indexing a polygon set and setting the Polygon as template
> parameter), even if that Polygon is not used itself.
>
> But it does not necessarily have to be a Geometry, the only thing used
> is its point-type.

Now, default Box type is geometry::box<geometry::point<...>>. Point's
template parameters are taken from Translator::indexable_type so from
some Box or Point. indexable_type of default translator is first Box or
Point which may be extracted from Value.

It should be up to the translator to provide proper type which may be
indexed. Spatial indexes which are able to handle boxes should take
translator translating Value to Box or Point. For indexes of spherical
objects it should probably translate to Sphere or Point. But translator
only extracts some indexable type from Value.

Regards,
Adam


Geometry list run by mateusz at loskot.net