[GRASS-dev] v.what and spatial index
Moritz Lennert
mlennert at club.worldonline.be
Wed Sep 13 06:24:53 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.
>> How would this change from the first approach (if v.what could easily be
>> made to accept multiple coordinates) ? This would again mean 'blindly'
>> collecting points before seeing the results, or having to call v.what
>> multiple times.
>
> v.what would read one coordinate pair, perform the lookup, write out
> the result(s), repeat until EOF.
>
> gis.m would start one v.what process; each time you click the mouse
> button, it would send the coordinates to the v.what process, read the
> result, then display it. It would need to restart v.what if the set of
> maps changed, but could use a single process to look up multiple
> points.
>
Here's my attempt at applying what you suggest. It's not very
complicated, and seems to work fine here, but I'd appreciate if someone
could check that I didn't do anything wrong before committing.
Now we will have to change the query function in the gis manager (from
line 1474 of gui/tcltk/gis.m/mapcanvas.tcl) to use v.what with the -s
flag and to provide continuous flow of coordinates and an EOF at the
end. Michael, can you do this ? Or could someone tell me in rough lines
how this can be done ?
Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.what.stdin.patch
Type: text/x-patch
Size: 1916 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060913/618b8241/v.what.stdin.bin
More information about the grass-dev
mailing list