v.to.rast explanation

Michel Wurtz - ENGEES/CEREG mw at engees.u-strasbg.fr
Tue Nov 30 05:31:18 EST 1999

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 :-)

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  Fax: +33

More information about the grass-user mailing list