0

I downloaded a SRTM hgt file from https://dds.cr.usgs.gov/srtm/version1/SRTM30/w100n40/w100n40.dem.zip, after unzipping I am not able to open it in QGIS or even gdalinfo. I downloaded other hgt files from this other site http://dwtkns.com/srtm30m/ and can open them without trouble; I read the file names have to do with the CRS of the file, so I played a little with the one that doesn't open, trying to follow the names of the one that does open, but not even this way I could read it; the one that opens starts with latitude (N19W097.hgt) whereas the one that does not open starts with the longitude (w100n40.hgt).

2

Yes, me too:

$ ls
w100n40.hgt
$ gdalinfo w100n40.hgt 
ERROR 4: `w100n40.hgt' not recognized as a supported file format.
gdalinfo failed - unable to open 'w100n40.hgt'.

I had a look at the folder where that problematic HGT file came from...

https://dds.cr.usgs.gov/srtm/version1/SRTM30/w100n40/

and there's a bunch of other stuff. I wonder if the "HDR.zip" file is useful, maybe it has some sort of essential header info. So I downloaded it and unzipped it. So now I have:

$  ls
W100N40.HDR  w100n40.hgt

And gdalinfo goes.....

$ gdalinfo w100n40.hgt 
Driver: EHdr/ESRI .hdr Labelled
Files: w100n40.hgt
       W100N40.HDR
Size is 4800, 6000
Coordinate System is `'
Origin = (-100.000000000000000,39.999999999999993)
Pixel Size = (0.008333333333330,-0.008333333333330)
Corner Coordinates:
Upper Left  (-100.0000000,  40.0000000) 
Lower Left  (-100.0000000, -10.0000000) 
Upper Right ( -60.0000000,  40.0000000) 
Lower Right ( -60.0000000, -10.0000000) 
Center      ( -80.0000000,  15.0000000) 
Band 1 Block=4800x1 Type=Int16, ColorInterp=Undefined
  NoData Value=-9999

woah! cool. I wonder what's in that HDR file:

$ strings W100N40.HDR 
BYTEORDER      M
LAYOUT       BIL
NROWS         6000
NCOLS         4800
NBANDS        1
NBITS         16
BANDROWBYTES         9600
TOTALROWBYTES        9600
BANDGAPBYTES         0
NODATA        -9999
ULXMAP        -99.99583333333334
ULYMAP        39.99583333333333
XDIM          0.00833333333333
YDIM          0.00833333333333

So it looks like this is a "EHdr/ESRI .hdr Labelled" format file and need the HDR and the HGT, unlike the other .HGT files which are SRTM HGT files:

$ gdalinfo N53W001.hgt
Driver: SRTMHGT/SRTMHGT File Format

Not sure about the other files in that download folder - they might have the projection and other useful metadata. Grab the lot and see! I see they have weird line ending characters so when I use cat on them I only see the last line (which is why I used strings above`).

If you go another level or two up you can drill down to the documentation which describes the files in that folder:

https://dds.cr.usgs.gov/srtm/version1/SRTM30/SRTM30_Documentation

Lessons: nose around your download sites for more info; don't think a file extension reliably tells you what a file is.

| improve this answer | |
  • I was confused because the other higher resolution (90 m) files in the same site do not have these additional files; anyway I was looking for the 30 m files (which I downloaded from the other link) but they're not in the dds site – Elio Diaz Jul 14 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.