[Gdal-dev] processing SRTM-3?

Markus Neteler neteler at itc.it
Thu Jul 29 03:40:51 EDT 2004


On Wed, Jul 28, 2004 at 03:05:20PM -0400, Frank Warmerdam wrote:
> Thom DeCarlo wrote:
> >Oops, found another... issue. The SRTM documentation states that the NODATA
> >value is -32768 and the shell script accommodates that by setting the
> >appropriate value in the header file. However, it appears that the rest of
> >the gdal software assumes that the NODATA value is -9999. Is there any way
> >to tell the gdal_translate program to change any NODATA values it 
> >encounters
> >to be -9999?
> 
> Thom,
> 
> The GDAL libraries should not assume a nodata value of -9999.  The data is
> being imported via the ESRI BIL format, right?  What does the .hdr file have
> for a NODATA value?  What does gdalinfo report about a dataset?

The .hdr is created in the script (example N59E018):

cat N59E018.hdr
BYTEORDER M
LAYOUT BIL
NROWS 1201
NCOLS 1201
NBANDS 1
NBITS 16
BANDROWBYTES 2402
TOTALROWBYTES 2402
BANDGAPBYTES 0
NODATA -32768
ULXMAP 18.0
ULYMAP 60.0
XDIM 0.000833333333333
YDIM 0.000833333333333


The resulting GeoTIFF file reports:

gdalinfo N59E018.tif
Driver: GTiff/GeoTIFF
Size is 1201, 1201
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235629972,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (17.999583,60.000417)
Pixel Size = (0.00083333,-0.00083333)
Corner Coordinates:
Upper Left  (  17.9995833,  60.0004167) ( 17d59'58.50"E, 60d 0'1.50"N)
Lower Left  (  17.9995833,  58.9995833) ( 17d59'58.50"E, 58d59'58.50"N)
Upper Right (  19.0004167,  60.0004167) ( 19d 0'1.50"E, 60d 0'1.50"N)
Lower Right (  19.0004167,  58.9995833) ( 19d 0'1.50"E, 58d59'58.50"N)
Center      (  18.5000000,  59.5000000) ( 18d30'0.00"E, 59d30'0.00"N)
Band 1 Block=1201x3 Type=Int16, ColorInterp=Gray
  NoData Value=-32768

---------------------

BUT - Thom: 
Please have a look at the other script on that page
as some more bit shuffling is needed to get a correct
map. The output of above script is not sufficient.

Shell script:
 http://mpa.itc.it/rs/srtm/r.in.srtm

The relevant piece is:
 echo "mapping down large values due to INT16 format..."
 r.mapcalc "$FILE.meters=if($FILE >= 32767, $FILE - 32768, $FILE)"

I hope I got that right in the script.


Markus




More information about the Gdal-dev mailing list