Subject: [ggl] spacial index
From: Bruno Lalande (bruno.lalande)
Date: 2011-03-28 14:17:01
> 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.
Agreed, I was about to answer that. The translator should dictate the Value
type used, and everything should be derived from that.
We could almost avoid the Value argument itself (since itself deductible
from Translator) but we would have a chicken-egg problem: default translator
is deduced from Value. So either we have both, or we don't default the
translator (i.e. let the user explicitly specify a default translator when
nothing special is needed). It might actually be better: if the user wants
to use a special translator, he has one less thing to specify (a redundant
thing, furthermore). And if not, he would have had to specify the Value
anyway so he will simply write something like
"rtree<default_translator<my_value> >" rather than "rtree<my_value>". It's
not a big deal and it makes clear straight away that the tree will not
actually store values (like a vector<my_value> would do).
-------------- next part --------------
An HTML attachment was scrubbed...
Geometry list run by mateusz at loskot.net