m.dem.extract

Morris Trimmer TRIMMER at fs.sciences.WLU.EDU
Fri Jul 22 10:46:58 EDT 1994


Jeri, Matt and others,
 I recently had problems and questions about importing 1deg DEMs 
(from edcftp.cr.usgs.gov/pub/data/DEM/250) and received the helpful 
message below.  Also very helpful for learning about DEMs and what 
the numbers in the header mean I suggest you look at the info via 
Mosaic http://edcwww.cr.usgs.gov/glis/hyper/guide/1_dgr_DEM
( if you dont have access to Mosaic I can send you an eddited copy).  
Also, get a copy of USGS booklet "Digital Elevation Models, Data 
Users Guide"
---begin included message---
The following is a set of general instructions and a specific example 
of the commands used to import 1 degree by 1 degress dem data:

EXAMPLE INSTRUCTIONS:

1)   dd if=diskfilename ibs=10240 | \
          m.dmaUSGSread top=1 bottom=400 left=1 right=500 \
              output=dem logfile=log

      Of course you need to substitute the right parmaters to describe 
the portion of the 1 degree by 1 degree area which you wish to 
extract; in this example the first 500 columns of the first 400 rows of 
data. These two paramater remain the same for steps 2 and 3. The 
blocking paramater (ibs) should NOT be changed, regardless of area
quad, etc.

2)      m.rot90  input=dem  output=dem.r90
          rows=400  cols=500  bpc=2

3)    Create a region (in UTM coordinates) with g.region, then

     r.in.ll input=dem.r90 output=dem.utm
             dimension=500,400 bpc=2 res=3,3
             corner=sw,37:13N,103:45W spheroid=wgs72

     in the last command you have to give lat-long for a corner of your 
dem using the wgs72 spheroid.  The r.in.ll command should create all 
the necessary support files for you.  But if you run into problems, just 
run r.support.   

SAMPLE SESSION:
[Note: Unlike the above instructions, in the following session I loaded 
the entire 1 degree by 1 degree area, i.e., 1201 rows by 1201 cols of 
data.]

Mapset <dem> in Location <whatever>
GRASS 4.0.2 > dd if=tulsa_w.dem ibs=10240 | m.dmaUSGSread top=1 
bottom=1201 left=1 right=1201 output=tulsa_w.out logfile=tulsa_w.log
The requested window is:
rows: 1-1201, cols 1-1201
863+1 records in
17261+1 records out

Mapset <dem> in Location <whatever>
GRASS 4.0.2 > m.rot90 input=tulsa_w.out output=tulsa_w.rot90 
rows=1201 cols=1201 bpc=2
1,1
1,101
1,201
1,301



More information about the grass-user mailing list