[GRASS-dev] v.what and spatial index

Moritz Lennert mlennert at club.worldonline.be
Fri Sep 8 03:47:16 EDT 2006


Glynn Clements wrote:
> Moritz Lennert wrote:
> 
>> 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.
> 
> The obvious approach is to extend v.what to allow coordinates to be
> read from stdin.
> 
> BTW, it appears that v.what currently ignores all coordinate pairs
> other than the first.

Didn't even try that, but yes. Shouldn't be too hard to implement, 
though. Trevor, any reason you left this out ?

On the other hand, I just noticed that it allows querying multiple maps.

Michael would it be possible to allow some form of multiple map 
selection in the gui to then call v.what with the names of all of these 
maps ?

> 
>> - 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.
> 
> This is a separate issue to making v.what more efficient; other
> modules may benefit from not having to regenerate the spatial index
> for each invocation.

v.what was just the example I stumbled upon.

Although:

mlennert at geog-pc40:~/SRC/GRASS/CVS/grass6/vector$ grep -R 
Vect_build_spatial_index *
v.what/main.c:            Vect_build_spatial_index ( &Map[i], NULL );

Is there another way of building the spatial index which other models use ?

Moritz





More information about the grass-dev mailing list