[gdal-dev] Aster tif files to hgt

Scott Arko saarko at alaska.edu
Tue Nov 8 12:43:37 EST 2011

Hello Mira,

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

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.


On Mon, Nov 7, 2011 at 4:24 PM, Jaromír Mikeš <mira.mikes at seznam.cz> wrote:

> > Od: Scott Arko <saarko at alaska.edu>
> Hello Scott,
> > To resample your data, you will need to call gdalwarp with the -tr
> option.
> >  This is specified in whatever the native units are for your projection.
> >  In the case of UTM, meters.  So, something like:
> >
> > gdalwarp -of SRTMHGT -tr 30 30 -r bilinear input.hgt output.hgt
> >
> > I see you also are using the -t_srs option.  I find it best if you can
> use
> > the EPSG codes when using -t_srs.  Something like
> >
> > gdalwarp -t_srs EPSG:13606 .....
> >
> > 13606 is for UTM Zone 6N.  Codes vary by zone.
> I can't find EPSG code for area I building map (18F, 19F - Patagonia)
> So I am doing this now in my script:
> gdalwarp -of GTiff -srcnodata 32767 -t_srs "+proj=utm +zone=18F
> +datum=WGS84" -rcs -order 3 -tr 30 30 -multi ASTGTM2_${tile}_dem.tif
> ${tile}.tif
> this goes fine, but when I am trying then convert to hgt having errors:
> gdal_translate -of SRTMHGT ${tile}.tif ${tile}.hgt
> Warning 1: The corner coordinates of the source are not properly aligned
> on plain latitude/longitude boundaries.
> ERROR 1: Image dimensions should be 1201x1201 or 3601x3601.
> Any suggestion?
> Thank you
> mira

Scott Arko
Alaska Satellite Facility Deputy Director
University of Alaska Fairbanks

903 Koyukuk Drive
Fairbanks, AK 99775
Phone: (907) 474 - 5570
email:  saarko at alaska.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20111108/55de0f7c/attachment-0001.html

More information about the gdal-dev mailing list