[gdal-dev] gdal_translate -a_srs

Greg Coats gregcoats at mac.com
Sat Jul 3 13:16:05 EDT 2010


Frank, I did that, and now gdalinfo shows the gdal_translate output GeoTiff does have the same values as those of the GeoTiff with the desired UTM projection for PROJCS to AUTHORITY
Coordinate System is:
PROJCS["NAD83 / UTM zone 18N",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-75],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26918"]]

then gdalinfo shows on the next 2 lines of its report that while the GeoTiff in the desired UTM projection has reasonable values for Origin and Pixel size, the gdal_translate output GeoTiff apparently still has its Origin and Pixel size values in latitude and longitude, which is apparently preventing Qgis from displaying the gdal_translate output GeoTiff. 
gdalinfo report for input GeoTiff
Origin = (271500.000000000000000,4335000.000000000000000)
Pixel Size = (38.385826771653548,-38.385826771653548)

gdalinfo report for gdal_translate output GeoTiff
Origin = (-78.000555555559998,40.000555555555515)
Pixel Size = (0.000092592592593,-0.000092592592593)
Is there another necessary step? Greg

On Jul 3, 2010, at 10:10 AM, Frank Warmerdam wrote:

> Greg Coats wrote:
>> gdal_translate -a_srs provides for the output file to be in a different projection than the input file.
>> What is the syntax for telling gdal_translate -a_srs to use the projection shown by gdalinfo to be used in the GeoTiff below, which is NAD 1983, UTM Zone 18N?
> 
> Greg,
> 
> One approach is to just copy the coordinate system portion, as
> below into a text file, perhaps "desired.wkt" and then
> do:
> 
> gdal_translate -a_srs desired.wkt in.tif out.tif
> 
> PROJCS["NAD83 / UTM zone 18N",
>    GEOGCS["NAD83",
>        DATUM["North_American_Datum_1983",
>            SPHEROID["GRS 1980",6378137,298.2572221010002,
>                AUTHORITY["EPSG","7019"]],
>            AUTHORITY["EPSG","6269"]],
>        PRIMEM["Greenwich",0],
>        UNIT["degree",0.0174532925199433],
>        AUTHORITY["EPSG","4269"]],
>    PROJECTION["Transverse_Mercator"],
>    PARAMETER["latitude_of_origin",0],
>    PARAMETER["central_meridian",-75],
>    PARAMETER["scale_factor",0.9996],
>    PARAMETER["false_easting",500000],
>    PARAMETER["false_northing",0],
>    UNIT["metre",1,
>        AUTHORITY["EPSG","9001"]],
>    AUTHORITY["EPSG","26918"]]
> 
> You can also pass the entire WKT string on the commandline but that tends to
> be difficult to quote and to remove the newlines.
> 
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100703/5a2347d8/attachment.html


More information about the gdal-dev mailing list