extracting DEMs/some answers!

Gurcharan Khanna khanna at alnitak.usc.edu
Thu Dec 2 16:18:13 EST 1993


hi,

i've finally had some success with importing some DEM files about which I
had queried this group. many thanks to all those who made suggestions. i
won't summarize all the suggestions but will just state what worked for me.

first, the DEM data in question are apparently DMA versions distributed by
USGS and not USGS format. Thus, I had to use m.dmaUSGSread instead of
m.dem.extract. i noticed that the DMA versions have record lengths about
1021 chars while the USGS version had a record length of about 32,000 chars 
(which i successfully extracted with m.dem.extract).

the .txt files accompanying the data gave number of rows and columns as
1201 and 1201, spheroid as wgs72, res as 3, and lat/lon bounds, so i used: 

   dd if=los_angeles_e.dem ibs=10240 | m.dmaUSGSread top=1 bottom=1201 \
      left=1 right=1201 output=demtest logfile=log

   m.rot90 input=demtest output=demtest.r90 rows=1201  cols=1201  bpc=2

Here, i had to establish a region with g.region based on the lat/lon given
and on UTM resolution. These were two BIG mistakes i made. since i had
looked in the data file directly with m.dem.examine/extract earlier, and
saw UTM coords, i assumed they must be the ones to use, also because they
were sensible values according to a USGS file i had imported for nearby San
Francisco.  But this was way off base. Instead i had to use m.ll2u on the
values in .txt file to get the correct UTM values.

Next I had to use a value on the order of 50 (meters?) as the res, not 3
(arc seconds). Using 3 the first ten times gave me rows by columns so large
that the rasterization took over two hours and still didn't finish. Now,
the following command worked just fine:

   r.in.ll input=demtest.r90 output=dem.utm3 dimension=1201,1201 bpc=2\
      res=3,3 corner=sw,34N,119W spheroid=wgs72


so, I'm glad to be able to display the data, but now have even more questions.

1) in setting g.region in UTM coords, does the res matter if it's too big or
too small? (aside from processing time). will the resultant cell file be the
same? is there a correct value for the res for g.region (90? meters).

2) how should i deal with adjacent DEMs that make up a region? concatenate
them into a huge map layer? or is there a way to logically join them so
that the system only deals with the portions it needs to?

3) my tiger layers as well as other imagery and global databases are in
lat/lon. do i need to convert all to UTM in order to combine these map
layers into a single database? (i'd rather do the opposite and just think in
lat/lon terms.)

4) anybody know where to get 7.5 minute DEMs free?

Thanks again to all those who helped.

-gurcharan s khanna
 dept. of geography &
 univ. computing services
 univ. of southern california



More information about the grass-user mailing list