[PROJ] ST_Transform returning different results in PostGIS 2.x and PostGIS 3.x

Rhea rhea.moubarak at gmail.com
Thu Aug 31 03:29:46 PDT 2023


Hello,

I am facing a problem with the function st_transform()and here is my analysis of this pb:

Example of SQL query with different results depending on PostGIS version:
select st_astext(st_transform(st_setsrid(st_point(398845.80866241, 6822815.8927889), 2154), 932001))

Projection 932001 to insert in spatial_ref_sys for testing :

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 932001, 'IGNF' , 320002101 , '+proj=lcc +nadgrids=ntf_r93.gsb,null +a=6378249.2000 +rf=293.4660210000000 +pm=2.337229167 +lat_0=49.500000000 +lon_0=0.000000000 +k_0=0.99987734 +lat_1=49.500000000 +x_0=600000.000 +y_0=200000.000 +units=m +no_defs' , 'PROJCS["Lambert I",GEOGCS["Nouvelle Triangulation Française Paris grades",DATUM["NTF",SPHEROID["Clarke 1880 IGN",6378249.2000,293.4660210000000,AUTHORITY["IGNF","ELG010"]],TOWGS84[-168.0000,-60.0000,320.0000,0,0,0,0],AUTHORITY["IGNF","REG002"]],PRIMEM["Paris",2.337229167,AUTHORITY["IGNF","LGO02"]],UNIT["grad",0.01570796326794897],AXIS["Longitude",EAST],AXIS["Latitude",NORTH],AUTHORITY["IGNF","NTFP"]],PROJECTION["Lambert_Conformal_Conic_1SP",AUTHORITY["IGNF","PRC0101"]],PARAMETER["semi_major",6378249.2000],PARAMETER["semi_minor",6356515.0000],PARAMETER["latitude_of_origin",49.500000000],PARAMETER["central_meridian",0.000000000],PARAMETER["scale_factor",0.99987734],PARAMETER["false_easting",600000.000],PARAMETER["false_northing",200000.000],UNIT["metre",1],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["IGNF","LAMB1"]]’);


This projection 932001 corresponds to Lambert Zone 1 corrected with the IGN grid.

On our PostgreSQL 10 / PostGIS 2.4 machine, we get:
POINT(347762.11171084 87364.0318659853)

While in PostgresQL 13 / PostGIS 3.0, we get this (result which is incorrect):
POINT(347200.5307476731 637506.2948565462)

Result of the query select postgis_full_version(); on our 2 environments:
PostgreSQL 10 : POSTGIS="2.4.7 r17330" PGSQL="100" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.3.2, released 2018/09/21" LIBXML="2.9.1" LIBJSON="0.11" RASTER


PostgresSQL 13 : POSTGIS="3.1.8 c5ebc1f" [EXTENSION] PGSQL="130" GEOS="3.10.3-CAPI-1.16.1" PROJ="8.2.1" LIBXML="2.9.7" LIBJSON="0.13.1" LIBPROTOBUF="1.3.0" WAGYU="0.5.0 (Internal)” TOPOLOGY

What solution can make this work with PostGIS 3.x? 

I already created an issue on gis.stackexchange and one contributor tried to help me but his recommendations did not work for me. And he recommended that i’d subscribe to the mailing list and try here.
(ref: https://gis.stackexchange.com/questions/465055/st-transform-returning-different-results-in-postgis-2-4-and-postgis-3-0?noredirect=1#comment760991_465055)

Thank you so much for your time ! appreciated.

Regards,




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230831/6d0e848e/attachment.htm>


More information about the PROJ mailing list