Opened 7 years ago

Closed 5 months ago

Last modified 5 months ago

#4198 closed defect (fixed)

Incorrect management of lambert 2 étendu (EPSG:27572) in gdal tools

Reported by: tbouffon Owned by: warmerdam
Priority: normal Milestone:
Component: Utilities Version: 1.8.0
Severity: normal Keywords:
Cc:

Description

Hi, I have a few problems with the handling of lambert projected grids: Starting from a lambert 2 x,y,z file france.csv, I create a GMT grid with xyz2grd (see attached). This file does not have a coordinate system, so I add one with gdal_translate -a_srs . Three possibilities :

  • gdal_translate france.grd -a_srs EPSG:27572 file1
  • gdal_translate france.grd -a_srs '+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.337229166666667 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +units=m +no_defs' file2
  • gdal_translate france.grd -a_srs '+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +units=m +no_defs +pm=paris' file3

If I run gdalinfo :

  • file1 has odd geographic corners, I could not find any reason for them
  • file2's corners lat/lon are shifted because the prime meridian are ignored
  • file3's corners lat/lon are right

Verification is done thanks to cs2cs, because invproj ignores pm

If I gdalwarp these files to EPSG:4326 :

  • file1 is shifted south by ~ 10°
  • file2 is ok
  • file3 is ok

If I use s_srs EPSG:27572 the result is ok in every case.

Attachments (1)

france.grd.gz (24.4 KB) - added by tbouffon 7 years ago.
lambert2 france grid

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by tbouffon

Attachment: france.grd.gz added

lambert2 france grid

comment:1 Changed 3 years ago by Jukka Rahkonen

I can confirm the odd results with GDAL 1.11.1 The EPSG file in the proj directory has the following line for 27572.

27572> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs  <>

What is odd it that these two commands lead to different lat-lon corners:

gdal_translate france.grd -a_srs EPSG:27572 file1.tif
gdal_translate france.grd -a_srs "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs" file2.tif

File1:

Upper Left  (   47500.000, 2676500.000) (  7d56'33.24"W, 51d19'48.97"N)

File2:

Upper Left  (   47500.000, 2676500.000) (  7d50'10.83"W, 50d50' 2.61"N)

comment:2 Changed 5 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40839:

gdalinfo: make sure to display geodetic coordinates always in degree (and not potentially in another unit such as grad) (fixes #4198)

comment:3 Changed 5 months ago by Even Rouault

In 40840:

gdalinfo: make sure to display geodetic coordinates always in degree (and not potentially in another unit such as grad) (fixes #4198)

Note: See TracTickets for help on using tickets.