grass: grid saved as raster. 2

Greg Koerper greg at
Mon Aug 23 19:11:53 EDT 1993

> Thanks for your answer. v.mkgrid works fine but produces a
> raster
> with all cells equal to 0.
> Any idea of why?
> Agus

Because MY answer was wrong.  v.mkgrid works, but it does not define polygon
areas.  However, this approach may be salvagable if you have some skill with
shell scripts (or better yet, perl).

Without getting into the details, you can take the output of v.mkgrid and
convert it to GRASS ASCII vector format.  The programmer's manual gives a
thorough description of this simple format.  What is needed now is to convert
the line descriptions into a series of site descriptions.  This can be done
by merging the information you have regarding EW and NS resolution with the
line coordinates data.  Most of these lines (better here to say "arcs") are 
defined by two points, or coordinate pairs.  If you interpolate a series of sites
between each pair of coordinate pairs, the resulting lists can then be 
processed using the option to convert sites to raster, or by using the 
contributed (SCS?) command.  

As long as the described arcs are
absolutely horizontal or vertical, this is a relatively simple problem.  But,
alas, programming is required.

I wish I hadn't made it sound so simple the first time around.

More information about the grass-user mailing list