[postgis-devel] PostGIS 3 and MobilityDB

Darafei "Komяpa" Praliaskouski me at komzpa.net
Tue Jul 6 23:10:37 PDT 2021


Hello,

We have a similar issue with h3_pg extension: to export a polygon, it can
only build a Postgres polygon as there's no access to PostGIS code, and
convert in the SQL wrapper. That's a pain currently as I can't trivially
fix the need to export a multipolygon for the hexagons crossing
antimeridian - I don't have a simple way to serialize a postgis geometry
from C code of another extension.

Exporting the whole liblwgeom.h seems overkill: we changed the arrangement
of functions there multiple times since we stopped exporting library, that
part is internal to us.

Statically linking to the copy of liblwgeom will cause explosions when
using two versions with same func names at the same time.

I have a different thought: can we build a minimum wrapper lib,
postgis_c_api, whose signatures will be frozen, and that will be built
together with postgis and call functions from it? GSERIALIZED access apis
are what will enable both MobilityDB and h3_pg. We can track the users of
the calls directly in the comments for each function in the file :)

On Wed, Jul 7, 2021 at 4:11 AM Regina Obe <lr at pcorp.us> wrote:

> Esteban,
>
>
>
> We really do not want to do that.  It caused all sorts of packaging issues
> with versions of PostGIS linking to the wrong version of liblwgeom and
> packages trying to manage it separately from PostGIS.
>
> It led people to believe that liblwgeom is a library they can use and thus
> puts more strain on our workflow to manage the usage outside of PostGIS.
>
>
>
> That said liblwgeom itself I don’t think has that many dependencies and
> all the various extensions we have just statically link the code in to
> there extension.  Is it possible for you to just include that source as
> part of your code and do the same.
>
>
>
> Thanks,
>
> Regina
>
>
>
>
>
>
>
> *From:* postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] *On
> Behalf Of *Esteban Zimanyi
> *Sent:* Tuesday, July 6, 2021 8:10 PM
> *To:* PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
> *Cc:* Mahmoud Sakr <m_attia_sakr at yahoo.com>; mohamed sayed <
> mohamed_bakli at aun.edu.eg>; SCHOEMANS Maxime <Maxime.Schoemans at ulb.be>
> *Subject:* Re: [postgis-devel] PostGIS 3 and MobilityDB
>
>
>
> Dear Paul
>
> We indeed have PostgreSQL sources (from versions 10 to 14 beta) and
> PostGIS sources (version 2.5) when building MobilityDB in order to import
> the headers. However this is not enough.
>
> I know that maybe I am asking too much but is there any possibility that
> PostGIS will again export the library liblwgeom as was the case in the past
> before PostGIS version 3? That would be the ideal solution.
>
> Otherwise to implement your solution we would need to refactor MobilityDB
> into the PostGIS source tree so that it would be, e.g., a parallel
> directory to postgis_raster and the other PostGIS extensions.
>
> Unless there is another solution that I cannot foresee ...
>
> Esteban
>
>
>
> On Mon, Jul 5, 2021 at 10:35 PM Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
>
>
>
> > On Jul 3, 2021, at 12:49 AM, Esteban Zimanyi <esteban.zimanyi at ulb.be>
> wrote:
> >
> > Dear Paul,
> >
> > Many thanks for your reply. May I kindly ask you guidance on how to
> implement the solution you suggested?
>
> I think you will not have much choice but to build in the presence of
> PostgreSQL and PostGIS sources, so you can add the path to the liblwgeom.h
> header in your build step. Looking at how the ./raster subdirectory builds
> and links will probably be instructive, since it is also a module that (a)
> has its own types and functions (b) uses liblwgeom functionality and (c)
> depends on postgis being core loaded in order to run.
>
> I'm afraid I don't have much more to offer having not done this before,
> but at a minimum you'll need to have the various build artifacts of postgis
> core lying around so that implies a built source tree you can access.
>
> P.
>
>
> > We will closely follow any futur change in liblwgeom's public API and
> perform any required adaptation in MobilityDB code.
> >
> > Regards
> >
> > Esteban
> >
> > On Fri, Jul 2, 2021, 18:15 Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
> > The simplest expedient is to vendor in a versioned copy of liblwgeom.h
> and then trust us when we pinky-swear that the we don't change the public
> API between releases.
> >
> > P
> >
> > > On Jul 2, 2021, at 8:34 AM, Esteban Zimanyi <esteban.zimanyi at ulb.be>
> wrote:
> > >
> > > Alas MobilityDB only works with PostGIS 2.5. It was never possible to
> upgrade to version 3 since liblwgeom.h is not exported anymore.
> > >
> > > On Fri, Jul 2, 2021, 17:23 Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
> > >
> > >
> > > > On Jun 25, 2021, at 2:38 AM, Esteban Zimanyi <ezimanyi at ulb.ac.be>
> wrote:
> > > >
> > > > Now that our user base has considerably increased, we are
> continuously receiving the same question "What about PostGIS 3.1 support?"
> > > >
> > >
> > > I'm not sure I even understand the thrust of the question... what
> about it? Nothing has changed substantially in 3.1 in terms of code
> structure, etc. Why are not the same things you are doing with earlier
> versions working for 3.1?
> > >
> > > P.
> > > _______________________________________________
> > > postgis-devel mailing list
> > > postgis-devel at lists.osgeo.org
> > > https://lists.osgeo.org/mailman/listinfo/postgis-devel
> > > _______________________________________________
> > > postgis-devel mailing list
> > > postgis-devel at lists.osgeo.org
> > > https://lists.osgeo.org/mailman/listinfo/postgis-devel
> >
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-devel
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>


-- 
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20210707/0e935506/attachment.html>


More information about the postgis-devel mailing list