[postgis-users] Error: "Precision reduction requires GEOS-3.9 or higher"

474 views
Skip to first unread message

Marco Boeringa

unread,
Apr 16, 2021, 5:53:31 PM4/16/21
to PostGIS Users Discussion
Hi all,

I upgraded my Ubuntu 20.04 instance with "libgeos-3.9.0" from the
ubuntugis repository.

When I use:

"SELECT PostGIS_Full_Version();"

I get back:

POSTGIS="3.1.1 aaf4c79" [EXTENSION] PGSQL="130" GEOS="3.9.0-CAPI-1.16.2"
PROJ="6.3.1" LIBXML="2.9.10" LIBJSON="0.13.1" LIBPROTOBUF="1.3.3"
WAGYU="0.5.0 (Internal)"

which at least suggests I am now correctly using GEOS 3.9.0 (note: I
updated the PostGIS extension's functions using "ALTER EXTENSION postgis
UPDATE")

However, after adjusting some existing code to include the new
"ST_ReducePrecision" PostGIS function
(https://postgis.net/docs/ST_ReducePrecision.html), which is new in
3.9.0, I get back an error:

"Precision reduction requires GEOS-3.9 or higher"

which seems weird given the "PostGIS_Full_Version" result. Anyone have a
clue as to what I missed?

Marco

_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Paul Ramsey

unread,
Apr 16, 2021, 5:58:44 PM4/16/21
to PostGIS Users Discussion
It's curious, but the implication is that the postgis on your machine was built against an earlier GEOS. The version number that postgis reports for GEOS is generated at run-time, while the test of whether to include support for various functions is determined at compile-time. Hence you can see a "GEOS 3.9" version in your postgis, but still not have access to functions that are 3.9+ only.

P

Marco Boeringa

unread,
Apr 17, 2021, 3:01:42 AM4/17/21
to postgi...@lists.osgeo.org
Hi Paul,

Thanks for the response.

The virtual machine is a Microsoft "Hyper-V" instance with Ubuntu
20.04.2 LTS, as provided by Microsoft, that I upgraded by installing
PostgreSQL and PostGIS from the included Synaptic Package Manager, which
AFAIK references the official repositories for PostgreSQL and ubuntugis,
and the Canonical Partners repository:

"http://apt.postgresql.org/pub/repos/apt/focal-pgdg main"

"http://ppa.launchpad.net/ubuntugis/ppa/ubuntu focal main"

Before I upgraded libgeos from the ubuntugis repository,
"PostGIS_Full_Version()" showed GEOS 3.8.0.

So how do I potentially solve this? Or is this upgrade of GEOS only
possible by compiling PostGIS from source yourself (which I would
definitely like to avoid)?

Marco

Op 16-4-2021 om 23:58 schreef Paul Ramsey:

Marco Boeringa

unread,
Apr 17, 2021, 4:07:01 AM4/17/21
to postgi...@lists.osgeo.org
Hi Paul,

In addition to the information in the last post included below, in
Synaptic Package Manager, for the 'focal-pgdg/main(apt.postgresql.org)'
repo, I have the following selected / installed:

Package: postgresql-13-postgis-3 | Installed version:
3.1.1+dfsg-1.pgdg20.04+1

Package: postgresql-13-postgis-3-scripts | Installed version:
3.1.1+dfsg-1.pgdg20.04+1

Marco

Op 17-4-2021 om 09:01 schreef Marco Boeringa:

Sandro Santilli

unread,
Apr 18, 2021, 8:21:41 AM4/18/21
to PostGIS Users Discussion
On Sat, Apr 17, 2021 at 09:01:33AM +0200, Marco Boeringa wrote:

> Before I upgraded libgeos from the ubuntugis repository,
> "PostGIS_Full_Version()" showed GEOS 3.8.0.
>
> So how do I potentially solve this? Or is this upgrade of GEOS only possible
> by compiling PostGIS from source yourself (which I would definitely like to
> avoid)?

No way out of compiling PostGIS from source.
It could be done by you or by some third party who could have made
a package for your OS available.

--strk;

Marco Boeringa

unread,
Apr 18, 2021, 8:42:24 AM4/18/21
to postgi...@lists.osgeo.org
Hi Sandro,

Thanks for the answer, but this just raises a question, why was the
official PostGIS 3.1.1 as available in the

"http://apt.postgresql.org/pub/repos/apt/focal-pgdg main"

repository, not compiled with GEOS 3.9.0, if it is supposed to be able
to take advantage of new GEOS 3.9.0 functionality?

Of course, I understand GEOS 3.9.0 was not available at the time Ubuntu
Focal 20.04 LTS was launched, but neither was PostGIS 3.1.1. Yet PostGIS
was updated to 3.1.1 on Focal through the PostgreSQL repository for Focal?

Or would a PostGIS 3.1.1 compiled against GEOS 3.9.0 cause issues on a
default Ubuntu Focal install with just GEOS 3.8.0, due to incompatibilities?

Sorry if I am rambling and this doesn't make sense. Although I am slowly
getting to know Linux and Ubuntu, some of this packaging and repository
stuff is still a bit of a mystery to me...

Marco

Op 18-4-2021 om 14:21 schreef Sandro Santilli:

Paul Ramsey

unread,
Apr 18, 2021, 2:10:35 PM4/18/21
to PostGIS Users Discussion
We aren't the pgdg packers, so we cannot answer that for you, but there is a list you could ask...

https://www.postgresql.org/about/news/pgdg-apt-repository-for-debianubuntu-1432/

It's probably just an oversight.

P

Marco Boeringa

unread,
Apr 18, 2021, 3:02:27 PM4/18/21
to postgi...@lists.osgeo.org
Hi Paul,

Thanks, yes, I was suspecting something like this, just wasn't entirely
sure given my limited experience with Ubuntu up to now.

Marco

Op 18-4-2021 om 20:10 schreef Paul Ramsey:

Marco Boeringa

unread,
Apr 18, 2021, 3:11:11 PM4/18/21
to postgi...@lists.osgeo.org
It also appears someone else already raised this issue recently:

https://www.postgresql.org/message-id/CAB2Z92DeQM2mjfMGfoWadp7OegfqMGi_sO_VE8%3Dt0WUWGa%2B6VQ%40mail.gmail.com

Reading through the thread, the next Debian release at the end of 2021
should ship with GEOS 3.9.0. As I understood it, Ubuntu packaging
follows on after Debian, isn't it? So general availability is likely at
the end of this year at the earliest... A bit of patience is still
needed I guess.

Marco

Op 18-4-2021 om 21:02 schreef Marco Boeringa:

Sandro Santilli

unread,
Apr 18, 2021, 3:25:24 PM4/18/21
to PostGIS Users Discussion
On Sun, Apr 18, 2021 at 02:42:14PM +0200, Marco Boeringa wrote:
> Hi Sandro,
>
> Thanks for the answer, but this just raises a question, why was the
> official PostGIS 3.1.1 as available in the
>
> "http://apt.postgresql.org/pub/repos/apt/focal-pgdg main"
>
> repository, not compiled with GEOS 3.9.0, if it is supposed to be able
> to take advantage of new GEOS 3.9.0 functionality?

You should ask the packagers. This is all a community
effort, and you can even make a difference by contributing
your time to do those builds yourself I think :)

> Or would a PostGIS 3.1.1 compiled against GEOS 3.9.0 cause issues on a
> default Ubuntu Focal install with just GEOS 3.8.0, due to
> incompatibilities?

To my knowledge GEOS upgrade never introduce incompatibilities,
unless there are packages that are using the C++ API of GEOS
(which we've campaigned enough to avoid)

Imre Samu

unread,
Apr 18, 2021, 3:37:30 PM4/18/21
to PostGIS Users Discussion
> Reading through the thread, the next Debian release at the end of 2021 should ship with GEOS 3.9.0.

Maybe May/June?    based on this info:
https://lists.debian.org/debian-release/2021/04/msg00187.html "Finding a tentative bullseye release date"
"The Release Team believes that the state of bullseye is pretty good."
"... We propose to aim for a release date in May."

Imre

Reply all
Reply to author
Forward
0 new messages