[GRASSLIST:1924] USGS "Native format" DEM files. Importing?

Tom Russo russo at swcp.com
Fri Jun 8 03:24:30 EDT 2001


I just purchased a handful of USGS Large Scale (1:24000) DEM files.
Unfortunately they have not put the most up-to-date DEMs into SDTS format ---
I've had great luck reading the SDTS files with r.in.gdal.  But the USGS
migration to SDTS is not complete, so for the data corresponding to the latest
USGS quad maps, with the NAD83 datum, you have to buy their "native format"
files.  They're not very nice files.  Fortran "formatted" records.  All one
big line with no record delimiters.  Some of the double precision numbers run
into each other due to the format statements.  Blech.

According to the what I can find in grass5beta11, r.in.dem should be able to
read them.  I haven't been able to make it work yet.  For starters, the files
were written by a fortran program, and some of the floating point numbers are
of the form 0.##########D+0# instead of 0.##########E+0#.  So the C code in
r.in.dem that uses fscanf(infile," ... %f ...",...,&doublevar,...) doesn't
work.  No problem, suck the thing into emacs and change all the D+0 into E+0.
Now I can coerce r.in.dem to read the header, but it complains about needing
East to be larger than West, and from there on out it's cornfused.  Later on
it complains that the DEM is in an unsupported projection "(not UTM)."  But of
course it *is* in UTM, and the "A record" of the DEM file says so.

I've tried inserting spaces between the
doubleprecisionnumbersthatgotruntogether but that didn't make this problem go
away.  

So has anyone got a favorite utility for taking USGS "Native" DEM files into a
form readily imported into GRASS?  Or has anyone figured out exactly how to
get these DEM files massaged so r.in.dem groks 'em?  A script would be
wonderful.

By the way, v.in.dlg reads "Optional" format USGS DLGs with no qualms.  Now to
figure out how to get the multiple attributes read and put into a relational
database as easily as v.in.sdts could do... 

Thanks,
T.

-- 
Tom Russo   KM5VY   QRPL #1592   K2#398     http://www.swcp.com/~russo/
Tijeras, NM DM64ux  SOC #236  ICQ#97201722  http://www.qsl.net/~km5vy/
 "What if the hokey pokey really is what it's all about?"



More information about the grass-user mailing list