[postgis-users] Postgis 3.0: How to convert liblwgeom to librttopo?

pt122 at gmx.net pt122 at gmx.net
Thu Jun 23 13:52:12 PDT 2022


Dear Postgis community, I'm not sure if I'm in the right forum but I want to give it a try. We want to upgrade from PostGIS 2.x to PostGIS 3.x and take over a self-written library (.so). This library was compiled with liblwgeom of PostGIS 2.x. liblwgeom seems to be not part of PostGIS 3.x anymore (/include/liblwgeom.h is missing for instance).

According to the comment in https://postgis.net/2019/10/20/postgis-3.0.0/, liblwgeom should be replaced with librttopo (which seems to be a fork of liblwgeom according to https://github.com/r-spatial/lwgeom/issues/30).

Our function that makes use of our lib, used for fast scaling, clipping and sorting-out coordinates, looks like:

CREATE OR REPLACE FUNCTION preprocess(geometry, box2d, ...)
RETURNS geometry AS 'path/to/lib.so', 'preprocess'
LANGUAGE c;
and in the c code are some LWGEOM*, LWMLINE*, LWMPOLY* and lwfree(..) calls.

My questions are:

- is lwgeom still part of Postgis 3.x? (I still see liblwgeom.h.in as part of postgis-3.2.1.tar.gz, so it seems that is not fully removed yet)

- if not, what would be a good starting point for conversion?

- are there any mappings of old and new functions or types available?

-are there any packages (besides librttopo and librttopo-devel) that must be installed additionally with librttopo (like GEOS or similar)?

-what are the PostGIS built-in alternatives for scaling and clipping?

Thank you for any hints, Peter

(See original post on https://gis.stackexchange.com/questions/434369/postgis-3-0-how-to-convert-liblwgeom-to-librttopo, but my problem is likely is too specific to ask in stackexchange...)


More information about the postgis-users mailing list