Opened 17 years ago

Closed 17 years ago

#1782 closed enhancement (fixed)

Inclusion of SRTM HGT read code in the library

Reported by: list67 Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: SRTM
Cc: warmerdam

Description

I wrote a srtmhgtdataset.cpp file that allows GDAL to read SRTM (1 arc second and 3 arc second) files. I tested the code on Windows (with gdalinfo, gdal_translate, OpenEV, and GlobalMapper) using SRTM files from this site (ftp://e0srp01u.ecs.nasa.gov/srtm/version2/). The code seems to work. The modifications are attached. Can the code be included in the GDAL library distribution so that users don't have to execute a file conversion preprocessing step in order to access the SRTM files?

Thank you.

Mike

Attachments (2)

srtmhgtMods.tar.gz (81.6 KB ) - added by list67 17 years ago.
GDAL Library Modifications For Adding SRTM HGT Read Support
gdal_svn_srtmhgt_driver.patch (18.3 KB ) - added by Even Rouault 17 years ago.

Download all attachments as: .zip

Change History (7)

by list67, 17 years ago

Attachment: srtmhgtMods.tar.gz added

GDAL Library Modifications For Adding SRTM HGT Read Support

comment:1 by Even Rouault, 17 years ago

Component: defaultGDAL_Raster
Version: unspecifiedsvn-trunk

It works nicely !

I took the liberty to modify it a bit to implement the Identify method. This is a new static method for drivers in GDAL 1.5. Its use is optionnal but it may speed up things a bit (I've also reordered the comparison for the filename length and extensions and the file size. It saves a file stat). I also used the EQUAL macro that is standard in GDAL for a portable way of doing strcasecmp. See the patch.

comment:2 by Even Rouault, 17 years ago

I'm updating the patch to fix a problem with bounding box report. The original version reports for a SRTM3 product :

Origin = (72.000000000000000,1.000000000000000)
Pixel Size = (0.000832639467111,-0.000832639467111)
Corner Coordinates:
Upper Left  (  72.0000000,   1.0000000) ( 72d 0'0.00"E,  1d 0'0.00"N)
Lower Left  (  72.0000000,  -0.0000000) ( 72d 0'0.00"E,  0d 0'0.00"S)
Upper Right (  73.0000000,   1.0000000) ( 73d 0'0.00"E,  1d 0'0.00"N)
Lower Right (  73.0000000,  -0.0000000) ( 73d 0'0.00"E,  0d 0'0.00"S)
Center      (  72.5000000,   0.5000000) ( 72d30'0.00"E,  0d30'0.00"N)

The pixel size is wrong as well as the corner coordinates because it doesn't take into account the fact that the external rows and columns are overlapping with those of adjacent products. This is exactly the samething for DTED products.

So, I've fixed that and now it reports :

Origin = (71.999583333333334,1.000416666666667)
Pixel Size = (0.000833333333333,-0.000833333333333)
Corner Coordinates:
Upper Left  (  71.9995833,   1.0004167) ( 71d59'58.50"E,  1d 0'1.50"N)
Lower Left  (  71.9995833,  -0.0004167) ( 71d59'58.50"E,  0d 0'1.50"S)
Upper Right (  73.0004167,   1.0004167) ( 73d 0'1.50"E,  1d 0'1.50"N)
Lower Right (  73.0004167,  -0.0004167) ( 73d 0'1.50"E,  0d 0'1.50"S)
Center      (  72.5000000,   0.5000000) ( 72d30'0.00"E,  0d30'0.00"N)

by Even Rouault, 17 years ago

comment:3 by warmerdam, 17 years ago

Cc: warmerdam added

Even,

Would you like to go ahead and commit the new driver? If so, please go ahead and "seize" this ticket.

comment:4 by Even Rouault, 17 years ago

Commited in trunk in r12187

comment:5 by Even Rouault, 17 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.