[postgis-devel] PostGIS 3 and MobilityDB

Regina Obe lr at pcorp.us
Wed Jul 7 01:46:43 PDT 2021


How many functions are we talking about here in this postgis_c_api and how many of these are not already covered in librttopo?

 

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

 

I thought we had that solved so each static can’t see the other functions inside (I forget what we changed – I think Sandro had changed it something to do with not exporting symbols I think it was).  We had issues with this with raster, sfcgal, and postgis_topology earlier on cause they each have their own static copy of liblwgeom which each exported the symbols and were dancing around in an unwholesome manner.

I haven’t seen the issue you described here for a couple of years now.

 

My main concern with a postgis_c_api is that sounds like MobilityDB needs a lot of the functions which would mean that library would get fat very quickly and bind their versioning to our versioning.  I’d rather sort out why librtopo https://git.osgeo.org/gitea/rttopo/librttopo is not a viable solution while liblwgeom is as the point of librttopo was to have a minimalist liblwgeom

 

MobilityDB folks – you are welcome to our Dev meeting -  https://trac.osgeo.org/postgis/wiki/PostGISDevelopment2021

Signup is here -  https://nextcloud.osgeo.org/apps/polls/s/4w1vSTPsIuJySw7g

 

Thanks,

Regina

 

From: postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] On Behalf Of Darafei "Kom?pa" Praliaskouski
Sent: Wednesday, July 7, 2021 2:11 AM
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

 

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 <mailto: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 <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 <mailto:postgis-devel at lists.osgeo.org> >
Cc: Mahmoud Sakr <m_attia_sakr at yahoo.com <mailto:m_attia_sakr at yahoo.com> >; mohamed sayed <mohamed_bakli at aun.edu.eg <mailto:mohamed_bakli at aun.edu.eg> >; SCHOEMANS Maxime <Maxime.Schoemans at ulb.be <mailto: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 <mailto:pramsey at cleverelephant.ca> > wrote:



> On Jul 3, 2021, at 12:49 AM, Esteban Zimanyi <esteban.zimanyi at ulb.be <mailto: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 <mailto: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 <mailto: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 <mailto:pramsey at cleverelephant.ca> > wrote:
> > 
> > 
> > > On Jun 25, 2021, at 2:38 AM, Esteban Zimanyi <ezimanyi at ulb.ac.be <mailto: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 <mailto:postgis-devel at lists.osgeo.org> 
> > https://lists.osgeo.org/mailman/listinfo/postgis-devel
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
> > https://lists.osgeo.org/mailman/listinfo/postgis-devel
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
> https://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
postgis-devel at lists.osgeo.org <mailto: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/f056d085/attachment-0001.html>


More information about the postgis-devel mailing list