Bug fixes for d.legend

I am using GRASS 4.21 (April 1999),
Anyone who is sick of d.legend not painting the legend color squares
correctly and who does not want to see the "1)" category numbers
as part of
the legend entries, might want to incorporate these fixes to main.c of
d.legend; Compare example map legends made with
old:
http://ippc2.orst.edu/wea/gis/prev/May_99/D_41n2May26.GIF
and new:
http://ippc2.orst.edu/wea/gis/prev/September_99/D_50n2September23.GIF

--------------------------------------------
diff main.c main.c_old
156,157c154
< /* next one detns top extent of color in box (def. 6; 5 goes one
higher)*/
< y_box[1] = (5-dots_per_line) ;
---

      y_box[1] = (6-dots_per_line) ;

161,162c158
< /* next one detns bottom extent of color in box (def. 6; 5 goes one
less)*/
< y_box[3] = (dots_per_line-5) ;
---

      y_box[3] = (dots_per_line-6) ;

also in new main.c
/* old version prints cat number which I dont want
                sprintf(buff, "%2d) %s", i, G_get_cat(i, &cats)) ;
*/
                sprintf(buff, "%s", G_get_cat(i, &cats)) ;
--------------------------------------------
PS I noticed these bugs when I first used GRASS 10 years ago, but
did not have access to source code back then. Someone should check
the first item on different hardware/operating systems before
deciding whether to incorporate it into new GRASS releases. 10 years
ago it was a SUN/SunOS I think. The second item is cosmetic and
should perhaps be made a command line option (please make the
default no cat number!)

Leonard Coop
Dept IPPC & Entomology

I'm trying to combine a vector streams map with a raster relief map, but
can't get v.to.rast (after using v.support) to work (just get an empty
raster). Can anyone point me to an explanation of how to convert a simple
vector line map like this to raster form? I assume I have to do this to
patch the two together.

Thanks! tom@bluesky.org

Tom Gewecke wrote:

I'm trying to combine a vector streams map with a raster relief map, but
can't get v.to.rast (after using v.support) to work (just get an empty
raster). Can anyone point me to an explanation of how to convert a simple
vector line map like this to raster form? I assume I have to do this to
patch the two together.

V.to.rast has the "feature" of using the arc attribute as the value
to fill the right cells on the raster. If you have not given any
attribute to an arc, it's like a zero value for the attribute. So
you trace 0 value vector on a 0 value background... It's exactly
the same when you have vector polygons. If they don't have a label
point, v.to.rast draw nice 0 areas on 0 background (Ah! the perfume
of invisibility :slight_smile:

How to correct that ? Use v.digit (digitizer: none) on your vector
file, eventually fill the scale on the header (v.digit won't work
without the scale specified), chose Label submenu (L), and Bulk
label remaining lines (B), giving them a value of 1.

Quit v.digit, run v.support, then v.to.rast, and you will see your
lines as cell values "1", the background remaining "0".

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97

Hi,

I think you might be able to help me.
I have a DEM, and another raster file showing the site boundary polygon,
converted from DXF. I would like to display the DEM in 3D, together with the
boundary outlines.

As Grass d.3d command still does not accept vector draping, my trick is to
merge the DEM and the boundary file into one. However, I guess I must have
use the wrong command cross product, the result has very different colour
for the original DEM. Do you have any idea on how to overlay the two files
in Grass?

Thank you
Khin Fah

----- Original Message -----
From: Michel Wurtz - ENGEES/CEREG <mw@engees.u-strasbg.fr>
To: <grass@cecer.army.mil>
Sent: Tuesday, November 30, 1999 6:31 PM
Subject: Re: v.to.rast explanation

Tom Gewecke wrote:
>
> I'm trying to combine a vector streams map with a raster relief map, but
> can't get v.to.rast (after using v.support) to work (just get an empty
> raster). Can anyone point me to an explanation of how to convert a

simple

> vector line map like this to raster form? I assume I have to do this to
> patch the two together.

V.to.rast has the "feature" of using the arc attribute as the value
to fill the right cells on the raster. If you have not given any
attribute to an arc, it's like a zero value for the attribute. So
you trace 0 value vector on a 0 value background... It's exactly
the same when you have vector polygons. If they don't have a label
point, v.to.rast draw nice 0 areas on 0 background (Ah! the perfume
of invisibility :slight_smile:

How to correct that ? Use v.digit (digitizer: none) on your vector
file, eventually fill the scale on the header (v.digit won't work
without the scale specified), chose Label submenu (L), and Bulk
label remaining lines (B), giving them a value of 1.

Quit v.digit, run v.support, then v.to.rast, and you will see your
lines as cell values "1", the background remaining "0".

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97

Bong Khin Fah wrote:

Hi,

I think you might be able to help me.
I have a DEM, and another raster file showing the site boundary polygon,
converted from DXF. I would like to display the DEM in 3D, together with the
boundary outlines.

If you are running Grass on an SGI box, you will find that SG3d will do all,
and more.
The OGL version of that application, which I think is called NVIZ, may have the
same, or similar functionality. You might want to look at these instead of
d.3d.

Cheers,

--
Terry Duell, Senior Mobility Engineer
Army Engineering Agency
Maribyrnong, Victoria, Australia
ph:61-3-93195837 fax:61-3-93195830

Hello,
I remember there was a grass command to output digital terrain models as
some kind of VRML code, eg: r.out.vrml !. I look through g.manual and could
not find something similar. Could someone refresh my memory and help
me find it.

Best Regards

Alejandro Hinojosa

Hi,
The command to generate VRML files from two raster maps
is p.vrml. As for as I recall, there is no manual but you can
get help by entering 'p.vrml -help' on your GRASS prompt.

Bye

Venkatesh Raghavan
Osaka City University

Alejandro Hinojosa wrote:

Hello,
I remember there was a grass command to output digital terrain models as
some kind of VRML code, eg: r.out.vrml !. I look through g.manual and could
not find something similar. Could someone refresh my memory and help
me find it.

Best Regards

Alejandro Hinojosa

Terry Duell wrote:

Bong Khin Fah wrote:

> Hi,
>
> I think you might be able to help me.
> I have a DEM, and another raster file showing the site boundary polygon,
> converted from DXF. I would like to display the DEM in 3D, together with the
> boundary outlines.
>
>

If you are running Grass on an SGI box, you will find that SG3d will do all,
and more.
The OGL version of that application, which I think is called NVIZ, may have the
same, or similar functionality. You might want to look at these instead of
d.3d.

nviz2.2 compiles on a linux box. There is still some problems, but
the results on screen are pretty good, including visualizing vector
files on top of rasters.

Before compiling, you need some libs, but the doc is clear, and
there wasn't too much problems (need a _recent_ version of MESAGL,
libtk, etc...)

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97