[GRASS5] more vector problems

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.

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.

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.

I doubt that either of these changes are the fixes that the most recent
authors would make to get the code working right.

Roger Miller

rgrmill@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@virgin.net>

On Tue, Apr 09, 2002 at 12:28:59AM +0100, Glynn Clements wrote:

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

Not quite. d.vect will draw all line work in one mode of operation,
whereas d.vect.[area|line] will only draw area or line edges for
labelled/built vector maps. We must keep d.vect with the capability
to draw even spaghetti vectors lines.

But, I thought I fixed this in February? At least, it was working
for me. Probably hasn't been merged into the release branch?

--
Eric G. Miller <egm2@jps.net>

Eric G. Miller wrote:

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

Not quite. d.vect will draw all line work in one mode of operation,
whereas d.vect.[area|line] will only draw area or line edges for
labelled/built vector maps. We must keep d.vect with the capability
to draw even spaghetti vectors lines.

But, I thought I fixed this in February? At least, it was working
for me. Probably hasn't been merged into the release branch?

There were significant differences between the head and release
versions of d.vect at the point that the release branch was
terminated.

The head version contains:

        D_add_to_list(G_recreate_command());
        D_set_dig_name(G_fully_qualified_name(
                    map_name, mapset));
        D_add_to_dig_list(G_fully_qualified_name(
                    map_name, mapset));

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