[PROJ] Is there a difference in the definition of a projection between postgis 2 and 3 ?

Rhea rhea.moubarak at gmail.com
Tue Dec 12 04:24:36 PST 2023


Hello again,

We finally managed to fix the solution in our installation.

File missing from the package: cdn.proj.org/fr_ign_ntf_r93.tif to be deposited in the PROJ installation directory for Centos/RHEL 8 (we deposited it via Filezilla in /tmp, and then copied it to the PROJ82 directory) 

bash 
#root mv /tmp/frignntf_r93.tif /usr/proj82/share/proj/ 
#root chmod 644 /usr/proj82/share/proj/frignntf_r93.tif 

Sources: proj.org/en/9.3/community/rfc/rfc-4.html blog.cleverelephant.ca/2023/02/proj-network.html cdn.proj.org 
This solution was implemented by INTM for ENEDIS.

Let me know if this is useful.

Regards,
Rhea

> On 18 Oct 2023, at 4:28 PM, Rhea <rhea.moubarak at gmail.com> wrote:
> 
> hello again,
> 
> we are still facing the same problem on our CentOS machines.
> 
> do you have any idea what could be the issue?
> 
> Thank you again for your help.
> 
> Best,
> Rhea
> 
>> On 15 Sep 2023, at 11:43 AM, Rhea <rhea.moubarak at gmail.com> wrote:
>> 
>> Hi,
>> 
>> Sorry for taking the time to get back to you.
>> 
>> We tested and it doesn't work. We still have the offset on the coordinates.
>> 
>> I think the problem is with this file:
>> 
>> https://github.com/OSGeo/proj-datumgrid/blob/master/ntf_r93.gsb
>> 
>> in the project folder, the file that we have is probably not the best one.
>> 
>> To install the file again, is there a projection package?
>> 
>> Before we had a projection package with this file: dnf install *proj*, does this still exist?
>> 
>> Thank you for your help.
>> 
>> Best,
>> Rhea
>> 
>>> On 5 Sep 2023, at 12:51 PM, Even Rouault <even.rouault at spatialys.com> wrote:
>>> 
>>> Hi,
>>> The WKT1 string for your IGNF:LAMB1 contains latitude_of_origin = 49.5. But this is wrong. This is the value in degree, but it should be expressed in grads as the GEOGCS unit is grad (cf https://gdal.org/tutorials/wktproblems.html#units-of-parameters), so 55 grad
>>> The correct WKT definition to use is:
>>> PROJCS["NTF Lambert I",
>>>     GEOGCS["NTF geographiques Paris (gr)",
>>>         DATUM["Nouvelle_Triangulation_Francaise_Paris",
>>>             SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627,
>>>                 AUTHORITY["EPSG","7011"]],
>>>             AUTHORITY["EPSG","6807"]],
>>>         PRIMEM["Paris",2.33722917,
>>>             AUTHORITY["EPSG","8903"]],
>>>         UNIT["grad",0.0157079632679489,
>>>             AUTHORITY["EPSG","9105"]],
>>>         AUTHORITY["IGNF","NTFPGRAD"]],
>>>     PROJECTION["Lambert_Conformal_Conic_1SP"],
>>>     PARAMETER["latitude_of_origin",55],
>>>     PARAMETER["central_meridian",0],
>>>     PARAMETER["scale_factor",0.99987734],
>>>     PARAMETER["false_easting",600000],
>>>     PARAMETER["false_northing",200000],
>>>     UNIT["metre",1,
>>>         AUTHORITY["EPSG","9001"]],
>>>     AXIS["Easting",EAST],
>>>     AXIS["Northing",NORTH],
>>>     AUTHORITY["IGNF","LAMB1"]]
>>> With recent PROJ, I get the correct value when using the proj.4 string or the corrected WKT1 definition (got from "projinfo IGNF:LAMB1 -o WKT1:GDAL")
>>> $ echo 398845.80866241 6822815.8927889 | PROJ_DATA=data PROJ_NETWORK=ON bin/cs2cs EPSG:2154 +to +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
>>> 347762.11    87364.03 0.00
>>> $ echo 398845.80866241 6822815.8927889 | PROJ_DATA=data PROJ_NETWORK=ON bin/cs2cs EPSG:2154 'PROJCS["NTF Lambert I",GEOGCS["NTF geographiques Paris (gr)",DATUM["Nouvelle_Triangulation_Francaise_Paris",SPHEROID["Clarke 1880 (IGN)",6378249.2,293.466021293627,AUTHORITY["EPSG","7011"]],AUTHORITY["EPSG","6807"]],PRIMEM["Paris",2.33722917,AUTHORITY["EPSG","8903"]],UNIT["grad",0.0157079632679489,AUTHORITY["EPSG","9105"]],AUTHORITY["IGNF","NTFPGRAD"]],PROJECTION["Lambert_Conformal_Conic_1SP"],PARAMETER["latitude_of_origin",55],PARAMETER["central_meridian",0],PARAMETER["scale_factor",0.99987734],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["IGNF","LAMB1"]]'
>>> 347762.11    87364.03 0.00
>>> Even
>>> Le 05/09/2023 à 12:19, Rhea a écrit :
>>>> hello, 
>>>> I am using this definition for my projection on both postgis 2 and postgis 3 so i can use it in my st_transform() function:
>>>> 
>>>> 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.
>>>> This is the function where im using this projection :
>>>> select st_astext(st_transform(st_setsrid(st_point(398845.80866241, 6822815.8927889), 2154), 932001))
>>>> On our PostgreSQL 10 / PostGIS 2.x machine, i am getting this: 
>>>> POINT(347762.11171084 87364.0318659853)
>>>> 
>>>> While in PostgresQL 13 / PostGIS 3.x, i am getting 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
>>>> I tried using fr_ign_ntf_r93.tif instead of the ntf_r93.gsb but it didnt work, i got the same results.
>>>> I tried verifying that the ntf_r93.gsb or the  fr_ign_ntf_r93.tif are located in usr/share/proj/ directory and they do but yet im getting the same results.
>>>> can anyone help me please?
>>>> Thank you so much !
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> PROJ mailing list
>>>> PROJ at lists.osgeo.org
>>>> https://lists.osgeo.org/mailman/listinfo/proj
>>>> 
>>> -- 
>>> http://www.spatialys.com
>>> My software is free, but my time generally not.
>> 
> 



More information about the PROJ mailing list