Inputting DEM data into GRASS

John Miller writes:

    {deleted stuff describing a DEM file format}
    What is the best way to import this data into a GRASS
    mapset? Is my only option to convert the data to a
    format suitable for r.in.ascii?

Katarina writes:

You can import the data as sites, using s.in.ascii, and then convert it
to raster, using one of the options in s.menu. That's how I did it when
I imported DEM data for an area in British Columbia.

Thank you for spending the time to reply to my request. I tried
your suggestion.

s.in.ascii worked fine as far as I can tell (once I worked out
that I had to make my Latitude values negative for the Southern
Hemisphere). A line in the file looks like:

        146.005|-19.5|313

However, (isn't there always an however :slight_smile: I can't get s.menu
to work in the way I require. I choose option 6 "Convert site
list to raster file (0/1)" and choose one cell per site. The
resulting raster file seems to only have zero values for the
elevations.
've tried editing the site_lists file to include a #
character before the "description" field as suggested in the
manual, so that the line in the file shown above looks like:

        146.005|19.5|#313

This didn't seem to work either.

I checked the current region was correct with g.region.
Any clues? Is there a problem concerning expressing the LAT/
LONG values in degrees and thousandths of degrees ?

+---------------------------------------------------------------------+
| John Miller | Internet Mail - ccjwm@jcu.edu.au |
| Computer Centre | PSI Mail - PSI%050527372000051::J_MILLER |
| James Cook University of North Queensland | Phone: +61 77 815447 |
| Townsville, 4811, AUSTRALIA | Fax: +61 77 796371 |
+---------------------------------------------------------------------+

In info.grass.user you write:

John Miller writes:

    {deleted stuff describing a DEM file format}
    What is the best way to import this data into a GRASS
    mapset? Is my only option to convert the data to a
    format suitable for r.in.ascii?

Katarina writes:

You can import the data as sites, using s.in.ascii, and then convert it
to raster, using one of the options in s.menu. That's how I did it when
I imported DEM data for an area in British Columbia.

Thank you for spending the time to reply to my request. I tried
your suggestion.

s.in.ascii worked fine as far as I can tell (once I worked out
that I had to make my Latitude values negative for the Southern
Hemisphere). A line in the file looks like:

       146.005|-19.5|313

However, (isn't there always an however :slight_smile: I can't get s.menu
to work in the way I require. I choose option 6 "Convert site
list to raster file (0/1)" and choose one cell per site. The
resulting raster file seems to only have zero values for the
elevations.
've tried editing the site_lists file to include a #
character before the "description" field as suggested in the
manual, so that the line in the file shown above looks like:

       146.005|19.5|#313

This didn't seem to work either.

I checked the current region was correct with g.region.
Any clues? Is there a problem concerning expressing the LAT/
LONG values in degrees and thousandths of degrees ?

The problem you are encountering MAY be the 4.0 version of s.menu.
s.menu was originally written to only use integer coordinates,
truncating the coordinate values at the decimal point. This has
been fixed - the update is on moon.
--

Michael Shapiro U.S. Army CERL
Environmental Division
P.O. Box 9005
Champaign, Ill. 61826-9005

email: shapiro@zorro.cecer.army.mil
phone: (217) 352-6511 ext 526
fax: (217) 373-7222