[gdal-dev] gdal_translate -a_srs
Frank Warmerdam
warmerdam at pobox.com
Mon Jul 5 19:25:13 EDT 2010
Greg Coats wrote:
> Following Frank's suggestion, and in accordance with the web page GDAL
> Utilities http://www.gdal.org/gdal_utilities.html Creating New Files
> I issued these GDAL commands
>
> $ gdal_translate --version
> GDAL 1.7.2, released 2010/04/23
> $ gdal_translate -of GTiff -ot Uint16 -a_srs NAD83_UTM18N.wkt in.tif out.tif
> $ gdal_translate -of GTiff -ot Uint16 -a_srs EPSG:26918 in.tif out.tif
> The two out.tif files created are identical.
>
> gdalinfo shows that out.tif has the expected values for PROJCS through
> AUTHORITY, including
> UNIT["metre",1,
> but gdalinfo shows out.tif still has latitude longitude values for
> Origin and Pixel Size
> Origin = (-78.000555555559998,40.000555555555515)
> Pixel Size = (0.000092592592593,-0.000092592592593)
> rather than the expected Origin and Pixel Size values for NAD 1983, UTM
> Zone 18N of about
> Origin = (271500.000000000000000,4335000.000000000000000)
> Pixel Size = (38.385826771653548,-38.385826771653548)
>
> This Origin and Pixel Size difference prevents out.tif from being
> displayed by Qgis along with the original NAD 1983 UTM Zone 18N .tif. It
> is though the gdal_translate -a_srs process is only partially complete?
> What additional step is necessary so that out.tif has Origin and Pixel
> Size values in UTM, rather than lat/long?
Greg.
The -a_srs switch assigns a new coordinate system. It does not reproject
the image. I think you want to use gdalwarp like:
gdalwarp -t_srs EPSG:26918 in.tif out.tif
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the gdal-dev
mailing list