[GRASS-dev] v.what and spatial index

Moritz Lennert mlennert at club.worldonline.be
Thu Sep 7 11:43:45 EDT 2006


Hamish wrote:
>> Moritz Lennert wrote:
>>> v.what calls Vect_build_spatial_index()
> 
> 
> note that originally the spatial index *was* written to disk; try running
> GRASS 5.7.0 and see (?? not sure exactly when it was removed).
> 
> Anyway it was removed after 1-2 years of running with it.
> 
> Not a technical answer or argument against it, but be aware that it was
> removed with a lot of experience doing it the other way.
 >
 > further detail can be found in the mailing list archives from the time
 > it was removed. (maybe same time v.build.all was added?)

http://grass.itc.it/pipermail/grass-dev/2004-November/016036.html
and
http://grass.itc.it/pipermail/grass-dev/2004-November/016045.html

and
http://grass.itc.it/pipermail/grass-commit/2004-November/015712.html ff

The main reasoning behind this seems to have been for the needs of large 
point datasets.

Radim's tests here
http://grass.itc.it/pipermail/grass-dev/2004-November/016036.html

seem to indicate that when the spatial index is reused several times by 
the module, the overhead of building it on the fly is not so important.

However, v.what does not have an interactive mode (that's the whole idea 
of v.what so it fits better into the GUI). This means that since it 
builds the spatial index everytime you call it, everytime you use the 
query tool you get the building of the spatial index.

Now, I see several options from here:

- Change the query tool in the GUI so that it collects points and then 
sends the whole series to v.what. This has the big disadvantage that you 
don't see the results of your clicks immediately (i.e. you "blindly" 
click on a series of points and then push "go" to see the results for 
all of these points). It still means that whenever you resuse the query 
tool spatial index gets rebuilt which can be very annoying if you have 
to query information out of a map. So, even though this might be a 
temporary "solution", I don't find it very satisfactory.

- Reimplement an interactive version of v.what, or rather make it 
possible to use d.what.vect from the GUI. This would probably mean 
recoding d.what.vect in whatever the GUI language and call GRASS library 
functions from there.

- Reuse spatial index on disk, possibly making it optional on a 
per-location or even per-mapset basis, so that those that need can use 
it and those that would find it annoying could just ignore it.

Moritz




More information about the grass-dev mailing list