Re: [gdal-dev] Aster tif files to hgt
Jaromír Mikeš
mira.mikes at seznam.cz
Tue Nov 8 22:42:11 EST 2011
> Od: Scott Arko <saarko at alaska.edu>
Hello Scott,
> The error you are getting is because for the SRTM height format you need to
> have very specific coordinates for the tiles. I'm not sure I can exactly
> explain why this is, but you need to have 1201x1201 for the 1 degree tiles.
> Also, you need to use the -projwin option to have the corners line up
> properly. Here is a command I used to generate 1 degree tiles for a
> similar problem as yours (i.e. taking another format DEM and making it look
> like SRTM)
>
> gdal_translate -of SRTMHGT -projwin 72 30 73.000139 28.9998611
> SRTM_30m_ELLIPSOID_HGT_EXPANDED_MOSAIC_GEO N29E072.hgt
>
> You can see that the LR corner extends past 73/29 by one half an arc-second
> (.000139 degrees). This worked for my application and properly formatted
> the tiles. Hope this helps you sort out your problem.
This can be quite complicated to do for 58 tiles as I do...
I checked gdalinfo for hgt file which I try to "imitate" and file I created ... they are identical.
$ gdalinfo
[snip]
Size is 1201, 1201
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9108"]],
AUTHORITY["EPSG","4326"]]
Origin = (-72.000416666666666,-54.999583333333334)
Pixel Size = (0.000833333333333,-0.000833333333333)
Metadata:
AREA_OR_POINT=Point
Corner Coordinates:
Upper Left ( -72.0004167, -54.9995833) ( 72d 0'1.50"W, 54d59'58.50"S)
Lower Left ( -72.0004167, -56.0004167) ( 72d 0'1.50"W, 56d 0'1.50"S)
Upper Right ( -70.9995833, -54.9995833) ( 70d59'58.50"W, 54d59'58.50"S)
Lower Right ( -70.9995833, -56.0004167) ( 70d59'58.50"W, 56d 0'1.50"S)
Center ( -71.5000000, -55.5000000) ( 71d30'0.00"W, 55d30'0.00"S)
Band 1 Block=1201x1 Type=Int16, ColorInterp=Undefined
NoData Value=-32768
Unit Type: m
`gdalwarp -of GTiff -srcnodata 32767 -rcs -order 3 -ts 1201 1201 -multi ASTGTM2_${tile}_dem.tif ${tile}.tif` ;
`gdal_translate -of SRTMHGT ${tile}.tif ${tile}.hgt` ;
So maybe there is no need for other alignment even there is a warning.
And srmt2osm program my hgt files accepts.
Or am I wrong and -projwin option and proper alignment is needed for proper accuracy?
regards
mira
More information about the gdal-dev
mailing list