Opened 18 years ago

Closed 17 years ago

Last modified 14 years ago

#1315 closed defect (fixed)

gdal_translate : Lambert_Conformal_Conic_1SP and Lambert_Conformal_Conic_2SP

Reported by: favard@… Owned by: Even Rouault
Priority: highest Milestone: 1.4.3
Component: GDAL_Raster Version: unspecified
Severity: blocker Keywords: geotiff srs
Cc: favard@…, warmerdam, Kyle Shannon

Description (last modified by warmerdam)

I'm trying to translate a GRD file to a TIF raster, with new coordinate system.
This system is defined in a prj file.

PROJCS["NTF_France_III_degrees",GEOGCS["GCS_NTF",DATUM["D_NTF",SPHEROID["Clarke_1880_IGN",6378249.2,293.46602]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199432955]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["false_easting",600000],PARAMETER["false_northing",3200000],PARAMETER["central_meridian",2.337229166666667],PARAMETER["standard_parallel_1",44.1],PARAMETER["scale_factor",0.999877499],PARAMETER["latitude_of_origin",44.1],UNIT["Meter",1]]]

System projection is Lambert_Conformal_Conic_1SP.
when I run gdal_translate the system projection of the generated file is Lambert_Conformal_Conic_2SP....Why ?

PROJCS["NTF_France_III_degrees",
    GEOGCS["GCS_NTF",
        DATUM["unknown",
            SPHEROID["unnamed",6378249.2,293.4660200000038]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",0],
    PARAMETER["standard_parallel_2",0],
    PARAMETER["latitude_of_origin",44.1],
    PARAMETER["central_meridian",2.337229166666667],
    PARAMETER["false_easting",600000],
    PARAMETER["false_northing",3200000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]

The problem is that parameters for Lambert_Conformal_Conic_2SP seem to be wrong.
It seems that standard_parallel_1 and standard_parallel_2 cannot have the same value.

Is it a bug ?
How to resolve this problem ?

thank you for your answer...
I retrieve the same problem if I use gdalwarp tool.

It is

Attachments (2)

gdal-1.4.2-bug1315.patch (504 bytes ) - added by Even Rouault 17 years ago.
gdal_svn_bug1315.patch (537 bytes ) - added by Even Rouault 17 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by favard@…, 18 years ago

perhaps the bug is in the gt_wkt_srs.cpp file
in the function GTIFSetFromOGISDefn when Lambert_Conformal_Conic_1SP projection is recognized, ProjCoordTransGeoKey key is set with CT_LambertConfConic_2SP value. I think it should be set with CT_LambertConfConic_1SP value. Could you confirm me that it is the bug...
thank you

comment:2 by martinoty, 17 years ago

Yes, I can confirm this is a bug, and the correction is indeed quite simple: At frmts/gtiff/gt_wkt_srs.cpp#L1425 , replace:

CT_LambertConfConic_2SP );

with:

CT_LambertConfConic_1SP );

as you said.

comment:3 by Even Rouault, 17 years ago

Just making the patches (against 1.4.2 and SVN trunk) to make it easy to push it into SVN.

by Even Rouault, 17 years ago

Attachment: gdal-1.4.2-bug1315.patch added

by Even Rouault, 17 years ago

Attachment: gdal_svn_bug1315.patch added

comment:4 by warmerdam, 17 years ago

Cc: warmerdam added
Component: defaultGDAL_Raster
Description: modified (diff)
Keywords: geotiff srs added
Milestone: 1.4.3
Owner: changed from warmerdam to Even Rouault

Folks,

I concur with the analysis. Even, could you go ahead and apply your patches to branches/1.4 and trunk? Please leave it open as I will need to migrate the change into 1.4-esri branch.

comment:5 by Even Rouault, 17 years ago

Patch commited in branches/1.4 in r11916 and in trunk in r11917

comment:6 by warmerdam, 17 years ago

Resolution: fixed
Status: newclosed

I'm closing since I believe 1.4-esri has already been snapped into ArcGIS and everything else is taken care of.

comment:7 by Kyle Shannon, 14 years ago

Cc: Kyle Shannon added
Note: See TracTickets for help on using tickets.