[postgis-users] [XX000] ERROR: AddToPROJ4SRSCache: could not parse proj4 string

Regina Obe lr at pcorp.us
Mon Nov 13 10:24:34 PST 2017

That is so odd.  I thought the ST_Transform would always use PostGIS so not sure how those two could be different.

Only thing I can think of is perhaps ogr is somehow loading a different proj from PostGIS.

For example on Windows when I switched from proj 4.8 to proj 4.9.3, I think the library name changed from libproj-9.dll to libproj-12.dll
So maybe your apt-get is getting 4.8 and that is what is being used by ogr.

So it's possible I guess that GDAL is dynamically loading the old one in your case for ogr_fdw and new one in general PostGIS use.

Though it puzzles me that GDAL would even come into the picture when using ST_Transform since that just depends on proj and is a postgis function.  Then again proj I think is dynamically loaded in both cases so it's possible.

One other experiment,

On your fdw table, does this error out?  Trying to rule out ogr as culprit and check if it's some other bit being added to the geometry itself.

-- bulk load your fdw into new table
SELECT * INTO tmp_from_fdw  FROM your_fdw_table_here;

-- test with new table
SELECT ST_Transform(geom,4326) FROM tmp_from_fdw;

Presumably if it’s the fdw at fault, then your bulk inserted table should work.

Hope that helps,

-----Original Message-----
From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Andrew Joseph
Sent: Friday, November 10, 2017 6:33 PM
To: postgis-users at lists.osgeo.org
Subject: Re: [postgis-users] [XX000] ERROR: AddToPROJ4SRSCache: could not parse proj4 string

SELECT ST_AsText(ST_Transform(ST_Transform(ST_SetSRID(ST_Point(-97.353287,
31.105862), 4326), 2277),4326)); 

produces "POINT(-97.353287 31.1058619999995)" - so it appears to work

The table srid for both concerete and foreign tables shows as 2277.

Using st_transform(st_setsrid(geom,2277),4326) on the foreign table fails as well.

I've tried reverting my configuration back as far as possible (2.3.2 breaks on postgres 10+):

"POSTGIS="2.3.4 r16009" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" SFCGAL="1.3.0"
PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.0, released 2017/04/28"

This leads me to believe that either something is wrong with my PROJ configuration, as Paul suggested, or that something has been fundamentally broken between proj4.8 and proj4.9. Should I be able to rely on the standard Ubuntu 16.04 PROJ libraries? I've built 4.9.3 from source and also tried using standard packages:

apt-get install libproj9 libproj-dev proj-data proj-bin

Both installations result in the same issue. Am I missing a critical package, or is there environment variable that needs to be set for PROJ to work properly with postgis?

Sent from: http://postgis.17.x6.nabble.com/PostGIS-User-f3516033.html
postgis-users mailing list
postgis-users at lists.osgeo.org

More information about the postgis-users mailing list