1

I'm having some problems with Postgres/PostGIS after rebuilding my GDAL library:(

I wanted to add MrSID support in GDAL so rebuilt it with the MrSID SDK. Everything compiled ok and I am now able to open Raster .sid files within QGIS.

BUT I seem to have screwed my Postgres 9.3 install as now I have no PostGIS support. If I try and open previously functioning postgis databases in QGIS I get a ton of error messages indicating that my database has no working PostGIS support.

When I look at my databases in PGADMIN3 I get the following error: ERROR: could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so": /usr/lib/postgresql/9.3/lib/postgis-2.1.so: undefined symbol: GEOSHausdorffDistance

The postgis-2.1.so library is definitely present on my system and was working fie before I recompiled GDAL.

I'm running Ubuntu 13.10, Postgres 9.3, PostGIS 2.1, and GDAL 1.10.

This is how I compiled GDAL 1.10:

./configure --with-geos=yes --with-sqlite3 --with-python --with-spatialite --with-fgdb=/usr/local/FileGDB_API --with-postgres --with-odbc --with-curl=yes --with-mrsid=/usr/local/MrSID_DSDK/Raster_DSDK --with-mrsid_lidar=/usr/local/MrSID_DSDK/Lidar_DSDK --with-poppler=yes --with-jasper=yes --with-opencl=no --with-ogdi=no

Anyone have any idea how to fix this? Do I need to recompile Postgis against Gdal?!

Really appreciate any help with this for as usual I urgently need to use my postgis data!

Thanks

Marty

marty_c
  • 5,779
  • 5
  • 24
  • 27
  • Did you run ldconfig after the build/install? – joop Mar 20 '14 at 14:39
  • hi joop. Yes I ran ldconfig after the build... – marty_c Mar 20 '14 at 14:42
  • I compiled postgres with `--with-geosconfig=/opt/geos/bin/geos-config` and `--with-gdalconfig=/opt/gdal/bin/gdal-config` (and a few others) seen here: http://stackoverflow.com/a/8636703/2235885 (first hit under "Related" ) – joop Mar 20 '14 at 14:44
  • But do I actually need to recompile postgres? I just remembered I actually have 2 versions of Postgres on my system: 9.1 and 9.3. 9.1 doesn't have Postgis support, would I need to have specified which Postgres to build GDAL against?! – marty_c Mar 20 '14 at 14:51
  • Well, normally when a build breaks by unresolved symbols (either by static or dynamic loading) I assume that my building process missed some steps (such as rebuilding one of the parts), and I add the suspected step. The simplest way is to just rebuild everything. Having a separate clean machine (or VM) helps. – joop Mar 20 '14 at 18:03
  • hi joop, i was kind of trying to avoid that! But perhaps you're right. It seems though that I may have introduced some problems by adding MrSID support as the SDK ships with an older version of Geos. See here....[GDAL/Geos](http://gis.stackexchange.com/questions/90356/broken-postgis-support-gdal) – marty_c Mar 20 '14 at 18:13
  • ok so it seems I've resolved the problem by deleting the older version of the Geos library which was causing problems. But have QGIS is now a little buggy, crashing when I try and reproject spatial data. Going to test this a little more... – marty_c Mar 21 '14 at 06:29
  • IIRC Postgis 2.x has changed part of the api (explicit types are now needed in the function calls). Could be that some of the callers are still using the old interface. Best way to definetely avoid distribution dependancies is to compile everything you need. And install into your own directory tree (such as /opt), IMHO. BTW I am not a GIS expert, just been bitten a few times by dependacies caused stray binaries and libraries floating around in /usr and /usr/local/ . – joop Mar 21 '14 at 10:31

1 Answers1

2

The simplest way was to just rebuild everything - thanks @joop

marty_c
  • 5,779
  • 5
  • 24
  • 27