[GRASS5] more vector problems

Glynn Clements glynn.clements at virgin.net
Mon Apr 8 19:28:59 EDT 2002


rgrmill at rt66.com wrote:

> More bad news, I'm afraid.
> 
> I tried to use d.zoom on a monitor with just a vector map displayed.  
> D.zoom required that I provide a raster file before it would work.  I 
> looked into the code and found that it would do that only if it couldn't 
> find the vector file in the monitor's pad.  Looking further I found that 
> d.what.vect also had the same problem; it always required me to provide 
> the name of the file to query even when the file was already displayed.
> 
> After poking about a bit I got into d.vect and replaced the calls to 
> 
> D_add_to_list (G_recreate_command())
> 
> with
> 
> D_add_to_dig_list (G_fully_qualified_name(map_name,mapset)).
> 
> That made d.what.vect work.

It should be calling both functions. The first call is needed for the
monitor's auto-redraw, and for d.save. The second call provides
information which is used by d.zoom (and maybe other programs), but is
less crucial.

> After that change d.zoom would find the file but when I tried zooming in 
> I would get a blank screen.  D.zoom didn't redraw the screen after the 
> region was changed.

That makes sense; the information which is stored by the first call is
used to redraw the screen.

> I got into d.zoom/cmd/main.c and commented out a section of code that 
> loaded values into a string pointed to by cmd and left cmd initialized 
> to NULL.  After that d.zoom worked fine.

That's probably the wrong fix.

AFAICT, d.zoom has two modes of operation. It either redraws what was
already on the screen, or redraws specific maps.

In the first case, it appears to break if it can't determine what's
already on the screen from the cell/dig/site lists, although it
shouldn't actually need this information.

Changing d.vect to call D_add_to_dig_list(), without removing the call
to D_add_to_list(), should solve the original problem. However, d.zoom
should be made to work even if the cell/dig/site lists are empty,
using the command lists.

BTW, d.vect and d.area have been superseded by d.vect.{area,line}.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list