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)
Change History (7)
by , 17 years ago
Attachment: | srtmhgtMods.tar.gz added |
---|
comment:1 by , 17 years ago
Component: | default → GDAL_Raster |
---|---|
Version: | unspecified → svn-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 , 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 , 17 years ago
Attachment: | gdal_svn_srtmhgt_driver.patch added |
---|
comment:3 by , 17 years ago
Cc: | added |
---|
Even,
Would you like to go ahead and commit the new driver? If so, please go ahead and "seize" this ticket.
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
GDAL Library Modifications For Adding SRTM HGT Read Support