Version 31 (modified by knpa, 13 years ago) (diff)


Creating DEMs from ASTER or SRTM data

Note: The instructions below explain how to make an ASCII UTM DEM. If this DEM is intended for use with aplcorr, it will need to be a binary DEM instead. This is the same process but instead of r.out.ascii, use 'r.out.gdal format=ENVI type=Float32' from the lat long grass location. This will still need to be elevated to WGS84 and should be interpolated so there are no no-data values in the binary output

The ASTER GDEM is a global elevation dataset at 1-arc-second (30m) horizontal resolution, covering the earth from 83S-83N. More data about the dataset is available at, the dataset itself can be downloaded from

The Shuttle Radar Topography Mission mapped global elevations at a 3 arc second (90m posting) resolution between 60N and 56S. More information is available from, and the data are available via the USGS Earth Explorer

Both of these are relatively coarse for ARSF DEM usage but are sufficient in some cases. To create a DEM from these data:

  1. Obtain data. ASTER should be used in preference to SRTM unless there is a good reason not to.
  • SRTM from Expand the "Digital Elevation" link on the left and tick the box labelled "SRTM". Enter bounding co-ordinates for the area you want data for, clicking the green "+" icon after each one. Note that this currently seems not to always work correctly for locations in DMS format (at least in Firefox), you may need to switch to decimal degrees (which work fine). Click on the "Search" button in the bottom-right, and you should be presented with a list of items matching your search (there should be only one thing in it). Click on the "SRTM" link (you may need to enable pop-ups if you've got them blocked), and you will be presented with a list of matching SRTM tiles and download links - download the data you want to use. Note that only SRTM 3-arc-second resolution data is available for sites outside North America. For sites in North America higher resolution data can be obtained via the USGS Seamless Server
  1. The raw ASTER and SRTM data should be placed in ~arsf/ASTER and ~arsf/SRTM respectively (ARSF-DAN internal only - this isn't a requirement for use of azgcorr).
  1. Unzip the downloaded zip file. ASTER data will contain two GeoTIFFs (you want the "_dem" one) - the file name refers to the lat/lon of the bottom-left corner of the tile. For SRTM data, descend into the directory structure to find the file w001001.adf - this holds the actual data, though you can't move it without the rest of the directory structure.

If the ASTER data covers more than one tile, you will need to unzip lots of files - for convenience:

for zipfile in ls *.zip; do yes | unzip $zipfile; done

Each zipfile contains a file called Readme.pdf and piping yes into unzip lets us overwrite it each loop.

  1. Fire up Grass. Select a location in lat/long projection using WGS84 datum (create one if none available), make a note of the selected location and mapset names.
  1. Import the data file.

For ASTER data: input=<aster_tile>_dem.tif output=<MAP_NAME>

For SRTM data: input=w001001.adf output=<MAP_NAME>

Importing and patching multiple tiles

If the data you have downloaded spans multiple tiles, then you will need to run the above but inside a for loop like so:

For ASTER data:

for tile in `ls *_dem.tif`;
do input=$tile output=$tile.tile;

For SRTM data:

for tile in `ls *.adf`; input=$tile output=$tile.tile;

Once this is done, we need to stick all of the tifs together. First run

g.mremove rast=*

This will list all of the tiles you have just read in. The output should look something like:

Collecting map names for current mapset <Your_Mapset>...
The following files would be deleted:
g.remove rast=ASTGTM_N63W017_dem.tif.tile,ASTGTM_N63W018_dem.tif....

I will refer to the comma separated list after "rast=" as <TILELIST> from hereon - This is the bit you need.

Now run

g.region rast=<TILELIST>

And finally,

r.patch input=<TILELIST> output=<MAP_NAME>

Write down <MAP_NAME> somewhere - you will need it in a minute.

  1. Quit Grass and then start it up again. Select a location using UTM projection for the target area or create one if none is available - make sure you've got the right UTM zone. Note you can also use whatever other projection you want, but this guide assumes you want UTM.

Check For the UTM zone

  1. Move DEM to UTM location and set region. Here we can use the manual method of calculating the eastings/northings or simply grab them from the tile(s) we have input.

Manual: Use a conversion utility (eg see the spreadsheet at to determine the boundaries of the target flight in meters within the selected UTM zone. If the flight spans two or more UTM zones, you will have to calculate the offsets appropriate to work out the east and west boundaries of the area. eg. If western boundary is zone 32 and eastern boundary is zone 33, for eastern value use zone 32, add 750000 to value from spreadsheet to find eastings relative to zone 32 bound.

  • Set active region to calculated eastings/northings using
    g.region n=<north val> s=<south val> e=<east val> w=<west val> res=50
    For ASTER res=30
  • Use r.proj to convert from lat/long to UTM:
    r.proj input=<MAP_NAME> location=<lat/long_location> mapset=<lat/long_mapset> output=<output_map_name>
    Where <MAP_NAME> is what we created in step 4.
  • If r.proj gives an error saying that the input map is outside the bounds of the current region, go back to step 6 and check your numbers

Other method:

  • Set the northings/eastings to something very large e.g.
    g.region n=50000000 s=0 e=50000000 w=-50000000 res=50
    For ASTER res=30
  • Use r.proj to convert from lat/long to UTM:
    r.proj input=<MAP_NAME> location=<lat/long_location> mapset=<lat/long_mapset> output=<output_map_name>
    Where <MAP_NAME> is what we created in step 4.
  • Set the new region
    g.region rast=<output_map_name>

To run a GUI and check whether the DEM covers the correct area, or to make the area smaller, use:

gis.m &
  1. To elevate the SRTM/ASTER DEM to the WGS84 spheroid (as is required for LiDAR deliveries and LiDAR DEM patching) see Elevate an SRTM/ASTER DEM to the WGS84 spheroid.
  1. To output an ASCII DEM from the converted map, the instructions are the same as those on the NextMap page. Follow the instructions from about half-way down. Make sure to covert your DEM to an az-style header. If you want a dem for use by aplcorr then you need a binary dem - see the notes at the top of this page.
  1. When your DEM is finished, place it in ~arsf/dems and link it from within the individual projects. Make sure it's origin is contained in the file name e.g. <PROJECT_NAME>-ASTER.dem.