[gdal-dev] Enable --with-static-proj4 by default if ESRI FGDB option is given on Linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Enable --with-static-proj4 by default if ESRI FGDB option is given on Linux

Andrew Joseph
I ran into an issue a few days ago where an ogr_fdw foreign data wrapper in postgis was throwing 

[XX000] ERROR: AddToPROJ4SRSCache: could not parse proj4 string '+proj=lcc 
+lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 
+lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +datum=NAD83 
+units=us-ft +no_defs ' unknown elliptical parameter name 

See http://postgis.17.x6.nabble.com/XX000-ERROR-AddToPROJ4SRSCache-could-not-parse-proj4-string-td5011978.html

I built Proj4 from source and removed all apt packages that depended on proj4 and ensured that the relevant grids were installed. To my great astonishment and misery, the issue still persisted, so I assumed it was a bug in ogr_fdw gdal/postgis/gdal. After several days of  trying different version combinations to try to determine which package was responsible, I still received the same error. Finally, I recompiled GDAL without ESRI FGDB support and to my amazement everything worked perfectly.  I thought to myself, how could the FGDB library possibly affect proj4 when there is no libproj.so that comes with it? Then I found this:

http://osgeo-org.1560.x6.nabble.com/gdal-dev-compiling-gdal-with-esri-file-gdb-td5311469.html

Apparently the ESRI FGDB library is packaged in a nonstandard way that results in proj4 being embedded in the .so file -like a tapeworm -wreaking silent havoc on all packages that depend on proj4.

To save others from this hellish debugging process, it might be worth either checking for the FGDB libraries and throwing an error if GDAL is configured without --wtih-static-proj4=location or setting that option by default. 


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enable --with-static-proj4 by default if ESRI FGDB option is given on Linux

Even Rouault-2

 

> To save others from this hellish debugging process, it might be worth

> either checking for the FGDB libraries and throwing an error if GDAL is

> configured without --wtih-static-proj4=location or setting that option by

> default.

 

./configure should already output a warning about that situation at the end:

https://trac.osgeo.org/gdal/changeset/37668

I've turned that as an error:

https://trac.osgeo.org/gdal/changeset/40724

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enable --with-static-proj4 by default if ESRI FGDB option is given on Linux

Chris Marsh
As I have been unable to solve my strange proj4 related issues  as per

I wonder if this is at all related to my issues and why changing proj4 versions makes no difference....
Is --without-fgdb the correct way to disable this feature so I can test?

Cheers
Chris


On 15 November 2017 at 15:19, Even Rouault <[hidden email]> wrote:

 

> To save others from this hellish debugging process, it might be worth

> either checking for the FGDB libraries and throwing an error if GDAL is

> configured without --wtih-static-proj4=location or setting that option by

> default.

 

./configure should already output a warning about that situation at the end:

https://trac.osgeo.org/gdal/changeset/37668

I've turned that as an error:

https://trac.osgeo.org/gdal/changeset/40724

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enable --with-static-proj4 by default if ESRI FGDB option is given on Linux

Andrew Joseph
I've turned that as an error:

Thanks, much appreciated -that will probably save at least 10 people from sitting at a coffee shop at 3am, recompiling anxiously for the 100th time, pulling out what is left of their hair, subsisting on stale pizza and wondering why they chose a career in programming! 
I suppose in the future, I should pay more attention to the configure output when debugging rather than proceeding directly to make && make install -one of the downsides of utilizing new features with docker automated builds.

> I wonder if this is at all related to my issues and why changing proj4 versions makes no difference....
> Is --without-fgdb the correct way to disable this feature so I can test?

Chris,

It would only be related if you installed the ESRI Filegeodatabase driver located here https://github.com/Esri/file-geodatabase-api -NOT the built in OpenFileGDB driver. I installed this using the following commands:
FGDB_DIR=FileGDB_API-64gcc51
FGDB_DOWNLOAD=FileGDB_API_1_5_1-64gcc51.tar.gz
cd /tmp
wget -q -O /tmp/${FGDB_DOWNLOAD} <a href="https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5.1/${FGDB_DOWNLOAD}">https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5.1/${FGDB_DOWNLOAD}
tar -C /tmp -xzf /tmp/${FGDB_DOWNLOAD}
cd /tmp/${FGDB_DIR}
cp lib/* /usr/local/lib
cp include/* /usr/local/include
ldconfig

If you installed similarly, --without-fgdb wouldn't fix the issue since the proj4 culprit lib is still present and will still malevolently conflict. On my Ubuntu 16.04 setup, this actually failed only when ogr_fdw (a postgis extension that uses gdal) was utilized -not on GDAL itself. 
Using --with-static-proj4=<PATH(usually either /usr or /usr/local)> when configuring GDAL fixed the issue for me.

If you want to ensure you have proj4 installed properly, they provide a convenient Dockerfile that shows all necessary instructions here https://github.com/OSGeo/proj.4/blob/master/Dockerfile

On Wed, Nov 15, 2017 at 4:20 PM, Chris Marsh <[hidden email]> wrote:
As I have been unable to solve my strange proj4 related issues  as per

I wonder if this is at all related to my issues and why changing proj4 versions makes no difference....
Is --without-fgdb the correct way to disable this feature so I can test?

Cheers
Chris


On 15 November 2017 at 15:19, Even Rouault <[hidden email]> wrote:

 

> To save others from this hellish debugging process, it might be worth

> either checking for the FGDB libraries and throwing an error if GDAL is

> configured without --wtih-static-proj4=location or setting that option by

> default.

 

./configure should already output a warning about that situation at the end:

https://trac.osgeo.org/gdal/changeset/37668

I've turned that as an error:

https://trac.osgeo.org/gdal/changeset/40724

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev



_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Enable --with-static-proj4 by default if ESRI FGDB option is given on Linux

Chris Marsh
Hi Andrew,

Ah damn. Thanks for the info. 
Cheers
Chris



On 15 November 2017 at 16:52, Andrew Joseph <[hidden email]> wrote:
I've turned that as an error:

Thanks, much appreciated -that will probably save at least 10 people from sitting at a coffee shop at 3am, recompiling anxiously for the 100th time, pulling out what is left of their hair, subsisting on stale pizza and wondering why they chose a career in programming! 
I suppose in the future, I should pay more attention to the configure output when debugging rather than proceeding directly to make && make install -one of the downsides of utilizing new features with docker automated builds.

> I wonder if this is at all related to my issues and why changing proj4 versions makes no difference....
> Is --without-fgdb the correct way to disable this feature so I can test?

Chris,

It would only be related if you installed the ESRI Filegeodatabase driver located here https://github.com/Esri/file-geodatabase-api -NOT the built in OpenFileGDB driver. I installed this using the following commands:
FGDB_DIR=FileGDB_API-64gcc51
FGDB_DOWNLOAD=FileGDB_API_1_5_1-64gcc51.tar.gz
cd /tmp
tar -C /tmp -xzf /tmp/${FGDB_DOWNLOAD}
cd /tmp/${FGDB_DIR}
cp lib/* /usr/local/lib
cp include/* /usr/local/include
ldconfig

If you installed similarly, --without-fgdb wouldn't fix the issue since the proj4 culprit lib is still present and will still malevolently conflict. On my Ubuntu 16.04 setup, this actually failed only when ogr_fdw (a postgis extension that uses gdal) was utilized -not on GDAL itself. 
Using --with-static-proj4=<PATH(usually either /usr or /usr/local)> when configuring GDAL fixed the issue for me.

If you want to ensure you have proj4 installed properly, they provide a convenient Dockerfile that shows all necessary instructions here https://github.com/OSGeo/proj.4/blob/master/Dockerfile

On Wed, Nov 15, 2017 at 4:20 PM, Chris Marsh <[hidden email]> wrote:
As I have been unable to solve my strange proj4 related issues  as per

I wonder if this is at all related to my issues and why changing proj4 versions makes no difference....
Is --without-fgdb the correct way to disable this feature so I can test?

Cheers
Chris


On 15 November 2017 at 15:19, Even Rouault <[hidden email]> wrote:

 

> To save others from this hellish debugging process, it might be worth

> either checking for the FGDB libraries and throwing an error if GDAL is

> configured without --wtih-static-proj4=location or setting that option by

> default.

 

./configure should already output a warning about that situation at the end:

https://trac.osgeo.org/gdal/changeset/37668

I've turned that as an error:

https://trac.osgeo.org/gdal/changeset/40724

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev




_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev