Ticket #1315 (closed defect: fixed)

Opened 7 years ago

Last modified 3 years ago

gdal_translate : Lambert_Conformal_Conic_1SP and Lambert_Conformal_Conic_2SP

Reported by: favard@… Owned by: rouault
Priority: highest Milestone: 1.4.3
Component: GDAL_Raster Version: unspecified
Severity: blocker Keywords: geotiff srs
Cc: favard@…, warmerdam, kyle

Description (last modified by warmerdam) (diff)

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

gdal-1.4.2-bug1315.patch Download (504 bytes) - added by rouault 6 years ago.
gdal_svn_bug1315.patch Download (0.5 KB) - added by rouault 6 years ago.

Change History

Changed 7 years ago by favard@…

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

Changed 6 years ago by martinoty

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.

Changed 6 years ago by rouault

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

Changed 6 years ago by rouault

Changed 6 years ago by rouault

Changed 6 years ago by warmerdam

  • description modified (diff)
  • cc warmerdam added
  • component changed from default to GDAL_Raster
  • owner changed from warmerdam to rouault
  • milestone set to 1.4.3
  • keywords geotiff srs added

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.

Changed 6 years ago by rouault

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

Changed 6 years ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

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

Changed 3 years ago by kyle

  • cc kyle added
Note: See TracTickets for help on using tickets.