[GRASSLIST:2187] Re: How to Display USGS DEM Files?

Rich Shepard rshepard at appl-ecosys.com
Fri Jul 27 17:11:12 EDT 2001


On Fri, 27 Jul 2001, Tom Russo wrote:

> I had the same problem.  There is apparently a problem with those DEMs where
> the null values are set to huge negative numbers, screwing up the choice of
> color map.

> If you look at the GRASS FAQ web site there's a (somewhat outdated)
> description of how to import USGS DEMs in SDTS format.  In there they describe
> a procedure where you have to use sed to strip out the strange large negative
> numbers.  In that procedure you use sdts2ascii to convert the stds file to
> something GRASS can read (roughly) then edit it by hand and with sed to
> massage it into something GRASS can read (actually).

Tom,

  I read the faq (have it printed out, as a matter of fact), and ran into a
problem with the patch file, so I didn't build the tools. But, I read about
the problem and didn't associate it with my problems viewing what came in
via r.in.gdal.

> As I recall, when I used r.in.gdal to do exactly what you're doing, I followed
> the r.in.gdal run with r.out.ascii, then used a sed script to replace the
> things like -32768 with 0.  If you dump out your raster file with r.out.ascii
> and look at it for a few seconds it should be pretty obvious what to do to get
> it fixed up.

  There we are! That's the insight I was seeking. Thank you!

> Since I've already imported most of the DEMs I needed to work with and this
> procedure works well enough for the odd ones I may have to import from time to
> time, I have pretty much stopped trying to figure it out.

  Actually, I don't mind a multi-step process because I'm sure I can
automate the whole thing once I go through it manually.

Gracias!

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
 + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard at appl-ecosys.com
                 Making environmentally-responsible mining happen.



More information about the grass-user mailing list