Is there someone who can confirm they have been able to install PostGIS
3.0.1 via the official APT repository?:
https://wiki.postgresql.org/wiki/Apt
After using the Synaptics Package Manager to install the three packages
involved
("postgresql-12-postgis-3"/"postgresql-12-postgis-3-dbgsym"/"postgresql-12-postgis-3-scripts"),
and subsequently trying to create the PostGIS extension in pgAdmin4, I
get the following error:
ERROR: could not load library "/usr/lib/postgresql/12/lib/postgis-3.so":
/usr/lib/postgresql/12/lib/postgis-3.so: undefined symbol: GEOSMakeValid
I have been trying different things to fix this for past two days
including re-install, but to no avail. I have also attempted to include
the UbuntuGIS repository as a potential alternative resource of PostGIS
packages, but discovered the UbuntuGIS repository is lagging behind and
doesn't yet have packages for 20.04LTS.
Marco
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users
What do you mean with "Same problem with qgis"? Do you mean you've also encountered a "undefined symbol: GEOSMakeValid" error related to the "postgis-3.so" library when trying to use some tool in QGIS?
I have installed PostgreSQL 12 and PostGIS 3.0.1 via Synaptic
on Ubuntu 20.04 (Focal) and use CREATE EXTENSION (via pgAdmin4),
when I encounter the error.
Thanks Tom,
I have seen a similar error related to the "libgdal26" library,
but that was after other trials to get something running on Ubuntu
20.04 Focal, where I successfully installed PostGIS 2.5.4, but
then encountered issues when my code called the
"postgis_full_version()" function and errored out with the error
message below related to the "libgdal.so.26" library. However, as
said, this was with PostGIS 2.5.4, not with the PostGIS 3.0.1 I
actually want to install at this moment and that gave the other
error related to the "postgis-3.so" library.
SQL Error [XX000]: ERROR: could not load library
"/usr/lib/postgresql/11/lib/rtpostgis-2.5.so":
/usr/lib/libgdal.so.26: undefined symbol: GEOSMakeValid_r
Where: SQL statement "SELECT public.postgis_gdal_version()"
PL/pgSQL function postgis_full_version() line 34 at SQL statement
Marco
Hi Tom,
Thanks for the tip, but what did you do to remove the old install? Did you rely on Apt or Synaptic to remove the old libgeos version, or did you manually clean up folders? I had two versions of libgeos as well (3.7 and 3.8) if I remember well (need to start up the VM again to check), and removed the older one through Synaptic just leaving the 3.8 version, but that wasn't enough to solve my particular issues.
Marco
Tom,
Thanks for this info.
I now discovered that, despite removing the "libgeos-3.7.0" by
using Synaptic, I also had a secondary version living in my
"/usr/local/lib/" folder. Purging all "libgeos" prefixed files
with the command you supplied, indeed made it now possible to use
CREATE EXTENSION for PostGIS in pgAdmin4. So there was a conflict
lurking there in the "/usr/local/lib/" folder. I actually have no
idea how the libgeos files ended up there, or why they weren't
removed by Synaptic if that used to be the official installation
folder.
I don't know if this is the only issue though, and would need to
start to test the current installation properly in order to make
sure everything is truly OK now, but it is at least a significant
step forward.
Marco
Tom,
One more question:
After successfully installing the PostGIS 3.0.1 extension using CREATE EXTENSION in pgAdmin4 on PostgreSQL 12.3 on Ubuntu 20.04 Focal, I now ran into an issue where it appears the 'ST_Accum' function is missing in my PostGIS install. My code calls this, and it failed. I then had a look at the function list in pgAdmin, and indeed 'ST_Accum' is not listed. I do see loads of other PostGIS functions, just 'ST_Accum' seems missing (although I cannot garantuee there are a few more missing functions, but the list seems pretty comprehensive from a quick look, and the CREATE EXTENSION call went without a hitch).
Can you confirm you see 'ST_Accum' in your PostGIS 3.0.1 function list if you look in pgAdmin? The PostGIS Help does not mention some deprecation of this function:
Marco
Whatever lives in /usr/local/lib was my manual build so I had to delete that manually.
Tom,
It now appears the PostGIS team indeed removed 'ST_Accum', but
forgot to update the online PostGIS Help. I see two OSGEO tickets
related to this:
https://trac.osgeo.org/postgis/ticket/4356
https://trac.osgeo.org/postgis/changeset/17397
Both mention replacing 'ST_Accum' with 'array_agg'.
Marco
Yes stray doc. Did you find this via google. Looks like that page last got updated 4/17/2019. It’s the nature of how we build the docs that the updates overwrite existing for a particular Minor version, but don’t delete.
So it existed early in the life cycle of 3.0 but was later removed
Anyway I’ve deleted ST_Length2D_Spheroid.html and ST_Point_Inside_Circle.html which also seemed to have the same issue
Yes stray doc. Did you find this via google.
Looks like that page last got updated 4/17/2019. It’s the nature of how we build the docs that the updates overwrite existing for a particular Minor version, but don’t delete.
Hi Regina,
Yes, I found this via Google. After the update, it now indeed errors out on a 404. ST_Collect also no longer mentions it, so that seems fine now.
I do slightly wonder by the way why ST_Accum wasn't simple re-implemented as a wrapper around 'array_agg'. While I appreciate breaking changes may be necessary and are to be expected for a major version update like 2.x to 3.x, in this particular case, where wrapping the function would have been an easy solution, could have avoided breaking existing code with minimal effort and maintenance overhead.
Anyway, the required code changes are luckily minimal as well,
just replace 'ST_Accum()' with 'array_agg()' as per the OSGeo
tickets I saw, so that is not a big deal. I have now implemented
this in my own code.
Marc,
Several reasons
1) Each function in itself is not that much, but compounded over many functions is a huge headache as if we change the newer version, we’d then have to remember to change the wrapper and in this case we’d have to keep track of what PostgreSQL is doing upstream since we have no control of array_agg. Aggregates are especially annoying since we had a state function tied behind this. So was really like 4 functions.
2) array_agg has been in PostgreSQL for a long long time. We assumed most users would be using that already instead of ST_Accum. There really was no reason to use ST_Accum past PostGIS 1.5 for any version of PostgreSQL. Granted we should have put a note on the page – deprecated so people new we’d be taking it out.
3) Wrappers are slower. In the case of ST_Accum(), I think it’s significantly slower
4) People are already complaining about too many functions in PostGIS. So keeping around old ones that we don’t want people using anyway just adds to the frustration of new users.
Hi Regina,
Thanks for explaining the reasons behind this. Yes, in hindsight putting a note up about deprecation could have helped, although in my case the function was part of some code I found on the Net and adjusted a little, so I didn't really have a reason to lookup the 'ST_Accum' function in the Help up to now, so would still have run into this.
Anyway, it is fixed now, and the code runs fine after switching
to 'array_agg'.
Marco