[gdal-dev] gdal_translate changes coordinate system

Frank Warmerdam warmerdam at pobox.com
Wed Jun 3 12:46:01 EDT 2009


Hermann Peifer wrote:
> [peifer at whitefish:lceugr100_06]> gdalinfo lceugr100_06_pct.tif
> Driver: GTiff/GeoTIFF
> Files: lceugr100_06_pct.tif
>        lceugr100_06_pct.aux
> Size is 67000, 58000
> Coordinate System is:
> PROJCS["ETRS_1989_LAEA_L52_M10",
>     GEOGCS["GCS_ETRS_1989",
>         DATUM["European_Terrestrial_Reference_System_1989",
>             SPHEROID["GRS_1980",6378137.0,298.257222101]],
>         PRIMEM["Greenwich",0.0],
>         UNIT["Degree",0.0174532925199433]],
>     PROJECTION["Lambert_Azimuthal_Equal_Area"],
>     PARAMETER["False_Easting",4321000.0],
>     PARAMETER["False_Northing",3210000.0],
>     PARAMETER["Central_Meridian",10.0],   <---
>     PARAMETER["Latitude_Of_Origin",52.0], <---
>     UNIT["Meter",1.0]]
...
> [peifer at whitefish:lceugr100_06]> gdalinfo template.tif
> Driver: GTiff/GeoTIFF
> Files: template.tif
> Size is 1000, 1000
> Coordinate System is:
> PROJCS["ETRS_1989_LAEA_L52_M10",
>     GEOGCS["GCS_ETRS_1989",
>         DATUM["European_Terrestrial_Reference_System_1989",
>             SPHEROID["GRS 1980",6378137,298.2572221010042,
>                 AUTHORITY["EPSG","7019"]],
>             AUTHORITY["EPSG","6258"]],
>         PRIMEM["Greenwich",0],
>         UNIT["degree",0.0174532925199433]],
>     PROJECTION["Lambert_Azimuthal_Equal_Area"],
>     PARAMETER["latitude_of_center",0],  <--
>     PARAMETER["longitude_of_center",0], <--
>     PARAMETER["false_easting",4321000],
>     PARAMETER["false_northing",3210000],
>     UNIT["metre",1,
>         AUTHORITY["EPSG","9001"]]]

Hermann,

The problem appears to be that for the first file the coordinate system
is being read from the .aux file, but not properly converted from ESRI
format to OGR format.  So the parameters should be named latitude_of_center
and longitude_of_center but instead are still using the ESRI names of
Central_Meridian and Latitude_Of_Origin.  The GeoTIFF writer does not
notice these values and writes default zeros for the lat/long of center
parameters in the geotiff file and that is what you get on read back.

I believe this is a failure of the .aux file reading logic to normalize
the coordinate system properly. Looking in the morphFromESRI() code there
appears to be handling for this transformation, so I suspect it is subtly
broken, or not being invoked by the .aux reader.

Could you file a ticket with the .aux file, and information on the version
of GDAL you are using?

As a work around you could paste the WKT with the zero lat/long of center
into a file (your_edited.wkt), edit in the correct values, and then
add "-a_srs your_edited.wkt" to the gdal_translate command.

But please do file the ticket - I'd like to fix this if the problem still
exists.

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