[Gdal-dev] Re: GDAL SRTM hgt code
WolfgangZ
wollez at gmx.net
Thu Aug 30 03:26:59 EDT 2007
list67 at netscape.net schrieb:
> Has anyone added code to GDAL so that a SRTM (1 or 3 arcsecond) hgt file
> can be passed to GDALOpen(...) for use?
>
> I did some searching and noticed that there are some format conversion
> workarounds for using the SRTM files with GDAL, but I didn't find any
> info about wether or not a more direct open capability had been
> implemented?
>
> Thank you.
>
> Mike
hi Mike,
you can have a look at the grass r.in.srtm script. It basically unzips
and renames the file to .bil and furthermore you need to create a
textfile with the same file name and the fiel ending .hdr with the
following content:
For 3arcsec data:
BYTEORDER M
LAYOUT BIL
NROWS 1201
NCOLS 1201
NBANDS 1
NBITS 16
BANDROWBYTES 2402
TOTALROWBYTES 2402
BANDGAPBYTES 0
NODATA -32768
ULXMAP $ULXMAP
ULYMAP $ULYMAP
XDIM 0.000833333333333
YDIM 0.000833333333333
of for 1arcsec data:
BYTEORDER M
LAYOUT BIL
NROWS 3601
NCOLS 3601
NBANDS 1
NBITS 16
BANDROWBYTES 7202
TOTALROWBYTES 7202
BANDGAPBYTES 0
NODATA -32768
ULXMAP $ULXMAP
ULYMAP $ULYMAP
XDIM 0.000277777777777778
YDIM 0.000277777777777778
You need to replace $ULXMAP and $ULYMAP with the upper left coordinates
of that tile. As s_srs you can use EPSG:4326.
Greetings
Wolfgang
More information about the Gdal-dev
mailing list