Opened 15 years ago

Closed 15 years ago

#3017 closed defect (fixed)

GDAL changes projection parameter values

Reported by: peifer Owned by: warmerdam
Priority: normal Milestone: 1.6.2
Component: GDAL_Raster Version: 1.6.0
Severity: normal Keywords: LAEA morph
Cc:

Description

Hermann wrote to the gdal mailing list:

> My original ccordinate 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]]

> ... after using gdal_translate, the coordinate system changes to:
> 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"]]]

Frank replied:

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.

Attachments (1)

lceugr100_06_pct.aux (7.6 KB ) - added by peifer 15 years ago.

Download all attachments as: .zip

Change History (3)

by peifer, 15 years ago

Attachment: lceugr100_06_pct.aux added

comment:1 by Even Rouault, 15 years ago

I think this is fixed in GDAL 1.7.0dev. See :

$ apps/gdalinfo lceugr100_06_pct.tif
[snip]
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["longitude_of_center",10.0],
    PARAMETER["latitude_of_center",52.0],
    UNIT["Meter",1.0]]
[snip]

whereas with GDAL 1.6.x, I also get "Central_Meridian" and "Latitude_Of_Origin". By looking (quickly) at the diff between trunk and GDAL 1.6.x in ogr/ogr_srs_esri.cpp, it appears that substantial work has been done, and in particular for LAEA projection to remap the parameter name.

Probably this change :

--- ../branches/1.6/gdal/ogr/ogr_srs_esri.cpp   2008-11-28 18:34:35.000000000 +0100
+++ ogr/ogr_srs_esri.cpp        2009-05-14 22:48:34.000000000 +0200
[SNIP]
@@ -1313,7 +1475,11 @@
             (char **)apszAlbersMapping + 1, 2 );
 
     if( pszProjection != NULL 
-        && EQUAL(pszProjection,SRS_PT_EQUIDISTANT_CONIC) )
+        && (EQUAL(pszProjection,SRS_PT_EQUIDISTANT_CONIC) ||
+            EQUAL(pszProjection,SRS_PT_LAMBERT_AZIMUTHAL_EQUAL_AREA) ||
+            EQUAL(pszProjection,SRS_PT_AZIMUTHAL_EQUIDISTANT) ||
+            EQUAL(pszProjection,SRS_PT_SINUSOIDAL) ||
+            EQUAL(pszProjection,SRS_PT_ROBINSON) ) )

comment:2 by warmerdam, 15 years ago

Keywords: LAEA morph added
Milestone: 1.6.2
Resolution: fixed
Status: newclosed

I have applied a variation on this that support to and from morphing in 1.6 (r17176) as well as adding tests for LAEA morphing in trunk (r17174) and 1.6 (r17175).

Note: See TracTickets for help on using tickets.