Users of ARC/INFO or ArcView can display the DEM data directly after renaming the file extension from .HGT to .BIL. However, if a user needs access to the actual elevation values for analysis in ARC/INFO the DEM must be converted to an ARC/INFO grid with the command IMAGEGRID. For IMAGEGRID to work there must be a separate header file whose name (including case) is exactly the same as the image file name. The contents of a sample file that works with 3 arc-second SRTM file N37W105.hgt are below -------------------------------------------------------------------------- BYTEORDER M LAYOUT BIL NROWS 1201 NCOLS 1201 NBANDS 1 NBITS 16 BANDROWBYTES 2402 TOTALROWBYTES 2402 BANDGAPBYTES 0 NODATA -32768 ULXMAP -105.0 ULYMAP 38.0 XDIM 0.000833333333333 YDIM 0.000833333333333 -------------------------------------------------------------------------- IMAGEGRID does not support conversion of signed image data, therefore the negative 16-bit DEM values will not be interpreted correctly. After running IMAGEGRID, an easy fix can be accomplished using the following formula in Grid: out_grid = con(in_grid >= 32768, in_grid - 65536, in_grid) The converted grid will then have the negative values properly represented, and the statistics of the grid should match those listed in the .ANN file. In addition, below are the contents of an AML script that may be helpful to ARCInfo users. Many thanks to several folks who contributed to the information presented here, including Curtis Price, Arthur Tarr, Colin Stark, Del Croom, robert Hijmans and Dean Gesch. /*-------------------------------------------------------------------------- /* Program: SRTMGRID.AML /* Purpose: Convert raw prelminary SRTM elevation data files /* (.hgt extension) to ESRI GRID format. Many thanks to /* Arthur Tarr, USGS, (atarr@usgs.gov) for figuring out how /* to convert SRTM image files to ArcInfo GRID format. /* /* The georeferencing and grid-cell resolution /* for the output grid is determined from the file /* name and the size of the file. /*-------------------------------------------------------------------------- /* Usage: &r srtmgrid /* /* Arguments: /* /* *.hgt binary file of elevation data /* File must be named according to convention /* on FTP site, e.g. N45W103.hgt /* /* Output grid name (must conform to ArcInfo naming /* conventions) /*-------------------------------------------------------------------------- /* Calls: *none* /*-------------------------------------------------------------------------- /* /* History: /* 01/28/02 Curtis Price, USGS, cprice@usgs.gov /* Original coding. Thanks to Arthur Tarr for figuring /* out the integer data transformation in GRID. /* 08/28/02 cprice /* Updated to work with newer data /* posted at ftp://edcsgs9.cr.usgs.gov/pub/data/srtm/GDPS /* Also fixed header to match documentation /* 11/19/03 cprice /* Updated to work with global data (all dd quadrants) /* /* ********************************************************************** /* /* Although this program has been used by the U.S. Geological /* Survey, no warranty, expressed or implied, is made by the USGS as to /* the accuracy and functioning of the program and related program /* material nor shall the fact of distribution constitute any such /* warranty, and no responsibility is assumed by the USGS in connection /* therewith. /* /************************************************************************ &args datfile outgrid &s os [extract 1 [show &os]] &if [null %outgrid%] &then &do &type Usage: &r srtmgrid &type Example: &r srtmgrid N45W122.hgt srtm1g &return &end &if %:program%_ eq ARC_ &then grid &if %:program%_ ne GRID_ &then &return This program must be run from ARC or GRID. &if %os%_ nc Windows_NT &then &do &s uxname %datfile% &s datfile [locase %datfile%] &if %datfile% ne %uxname% &then &sys mv %uxname% %datfile% &end &if ^ [exists %datfile% -file] &then &return *** Data file %datfile% not found &if [exists %outgrid% -dir] &then &return *** %outgrid% exists. Cannot create a grid with that name. /* extract image parameters from filename &s fn [locase %datfile%] &s xxll [unquote [translate %fn% ' ' nsew.hgt]] &s xxlat [extract 1 %xxll%] &s xxlon [extract 2 %xxll%] &if [type %xxlat%] ge 0 &then &s badfn &if [type %xxlon%] ge 0 &then &s badfn &if [variable badfn] &then &do &type Bad filename: %datfile% &type This AML requires that the original SRTM filename be used. &type For example: N44W103.hgt &return &end /* determine lat long sign &if [substr %fn% 1 1]_ eq s_ &then &s xxlat %xxlat% * -1 &if [substr %fn% 4 1]_ eq w_ &then &s xxlon %xxlon% * -1 /* calculate upper left corner of tile &s xxlat [calc %xxlat% + 1] /* determine arc-second resolution from filesize &s tmpfil [scratchname -suf .dat] &if %os% cn 'Windows_NT' &then &do &sys dir %datfile% /l /-c > %tmpfil% &s ch [open %tmpfil% st -r] &s rec [read %ch% st] &do &while %st% eq 0 and %rec% nc [locase %datfile%] &s rec [read %ch% st] &end &s st [close %ch%] &s xfn [unquote %rec%] &s filesize = [extract [calc [token %xfn% -count] - 1] %xfn%] &end &else &do &sys ls -l %datfile% > %tmpfil% &s ch [open %tmpfil% st -r] &s rec [read %ch% st] &s st [close %ch%] &s filesize [extract 5 [unquote %rec%]] &end &s st [delete %tmpfil%] &if [type %filesize%] > 0 &then &return ** ERROR problem determining file size &if %filesize% gt 5e6 &then &s arcsec 1 &else &s arcsec 3 /* calculate image size &s ncells [calc 3600 / %arcsec% + 1] &s cellsize [calc %arcsec% / 3600] &type Reading %datfile% as %arcsec%-arc-second DEM ... &type Copying image file ... /* create bil file &s tmpimg [scratchname -file -suf .bil] &s st [copy %datfile% %tmpimg%] /* write hdr file &s tmphdr [before %tmpimg% .bil].hdr &s ch [open %tmphdr% st -w] &s st [write %ch% 'BYTEORDER M'] &s st [write %ch% 'LAYOUT BIL'] &s st [write %ch% [quote NROWS %ncells%]] &s st [write %ch% [quote NCOLS %ncells%]] &s st [write %ch% 'NBITS 16'] &s st [write %ch% [quote ULXMAP %xxlon%]] &s st [write %ch% [quote ULYMAP %xxlat%]] &s st [write %ch% [quote XDIM %cellsize%]] &s st [write %ch% [quote YDIM %cellsize%]] &s st [close %ch%] &type Image parameters: &type &s ch [open %tmphdr% st -r] &s rec [read %ch% st] &do &while %st% eq 0 &type %rec% &s rec [read %ch% st] &end &s st [close %ch%] &type /* read into data file into grid format &s tmpgrid [scratchname -dir -suf g] arc imagegrid %tmpimg% %tmpgrid% /* convert image values as read to signed integer /* (imagegrid does not support signed integers) /* (Thanks to Arthur Tarr, USGS) %outgrid% = con(~ %tmpgrid% gt 32768, %tmpgrid% - 65536, ~ %tmpgrid% lt 32768, %tmpgrid%) /* Document projection for ArcInfo applications arc projectdefine grid %outgrid% projection geographic units dd zunits meters datum wgs84 param log %outgrid% add Created from SRTM input file %datfile% listoutput %tmphdr% init &format 6 describe %outgrid% &format 3 listoutput screen &s ch [open %tmphdr% st -r] &lv st ch &do &until %st% ne 0 &type [read %ch% st] &end &s st [close %ch%] kill %tmpgrid% all &s st [delete %tmpimg% -file] &s st [delete %tmphdr% -file] &if %os% nc 'Windows_NT' &then &if %datfile% ne %uxname% &then &sys mv %datfile% %uxname% &return Processing completed.