[GRASS-dev] how to display a vector map for d.path in gis.m?

Moritz Lennert mlennert at club.worldonline.be
Tue Jan 30 05:19:18 EST 2007


On 30/01/07 10:43, Otto Dassau wrote:
> Hi Moritz,
> 
> On Tue, 30 Jan 2007 10:03:10 +0100
> Moritz Lennert <mlennert at club.worldonline.be> wrote:
> 
>> On 30/01/07 08:37, Otto Dassau wrote:
>>> Hi, 
>>>
>>> I used the d.path module in gis.m and found that the map I chose for
> calculating
>>> the shortest path is not automatically displayed in the background. So I
> have a
>>> white monitor where I can select my starting and end nodes to display a red
>>> line.
>>>
>>> Is this missing or how do I have to use the module correctly in gis.m to
> display
>>> a vector map in the background? I used a grass cvs snapshot from today and
> tried
>>> with spearfish roads map.
>>
>> d.path uses the old monitor system, not the new gis.m display, so when 
>> you launch it through the gis.m menu, an x-monitor opens (with something 
>> like Monitor: x0 written in the title bar). You can display whatever you 
>> want in this monitor by using the command line, e.g.:
>>
>> d.vect roads
> 
> thanks for your help,
> 
> yes I saw that, but I think that it might  be more intuitive for a user to
> have the selected map for d.path visualized directly in the new x-monitor, when
> when you click on start.  
> 
> I mean, it is not an error, and of course one can easily type a d.vect roads
> command or whatever, but I found it strange that klicking on start you get an
> empty x-monitor and a usage desription for the mouse buttons in the Output
> monitor, but the map you selected in the d.path popup is not automatically
> displayed.
> 
> Maybe it is just my impression, so for me there is simply sth. missing. Could
> that not be added or is this difficult or not wanted?
> 
> maybe I should add a wish to the bugtracker... but I wanted to ask, if there is
> a special reason, why the selected map isn't displayed in the new x-monitor.

You are right that this is currently a bit counter-intuitive. The 
problem is that d.path was developed for the old monitoring system, 
where you would display your maps and then run d.path on them. Now that 
users use gis.m, and display their maps in the gis.m display, this 
obviously causes a problem. This said the man page actually states: " 
The user needs to display a vector map before using d.path."

d.path could be rewritten to display the chosen vector map 
automatically, but there might be situations where you don't want this 
map to be in the background, so imposing this might not be a good idea 
either...

In any case, I don't think we should invest any more development time 
into modules which depend on the x-monitors, so in my eyes the best 
solution would be to start from the non-interactive v.net.path and 
possibly write an interactive GUI wrapper around it which would allow 
you to click on start and end points and would then create a temporary 
vector file for display which it either discards afterwards or saves it 
to a given filename. I don't think this would be too complicated, maybe 
something for a python-programmer to try for the wxpython gui.

Moritz




More information about the grass-dev mailing list