<div dir="ltr">Hello,<div><br></div><div>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. </div><div><br></div><div>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.<br><br>Statically linking to the copy of liblwgeom will cause explosions when using two versions with same func names at the same time.</div><div><br></div><div>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 :)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 7, 2021 at 4:11 AM Regina Obe <<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-3953475165109503044WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Esteban,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Regina<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt"><div><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> postgis-devel [mailto:<a href="mailto:postgis-devel-bounces@lists.osgeo.org" target="_blank">postgis-devel-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Esteban Zimanyi<br><b>Sent:</b> Tuesday, July 6, 2021 8:10 PM<br><b>To:</b> PostGIS Development Discussion <<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a>><br><b>Cc:</b> Mahmoud Sakr <<a href="mailto:m_attia_sakr@yahoo.com" target="_blank">m_attia_sakr@yahoo.com</a>>; mohamed sayed <<a href="mailto:mohamed_bakli@aun.edu.eg" target="_blank">mohamed_bakli@aun.edu.eg</a>>; SCHOEMANS Maxime <<a href="mailto:Maxime.Schoemans@ulb.be" target="_blank">Maxime.Schoemans@ulb.be</a>><br><b>Subject:</b> Re: [postgis-devel] PostGIS 3 and MobilityDB<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Dear Paul<br><br>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.<br><br>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. <br><br>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. <br><br>Unless there is another solution that I cannot foresee ...<br><br>Esteban<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Mon, Jul 5, 2021 at 10:35 PM Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</a>> wrote:<u></u><u></u></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal"><br><br>> On Jul 3, 2021, at 12:49 AM, Esteban Zimanyi <<a href="mailto:esteban.zimanyi@ulb.be" target="_blank">esteban.zimanyi@ulb.be</a>> wrote:<br>> <br>> Dear Paul,<br>> <br>> Many thanks for your reply. May I kindly ask you guidance on how to implement the solution you suggested? <br><br>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.<br><br>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.<br><br>P.<br><br><br>> We will closely follow any futur change in liblwgeom's public API and perform any required adaptation in MobilityDB code.<br>> <br>> Regards <br>> <br>> Esteban <br>> <br>> On Fri, Jul 2, 2021, 18:15 Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</a>> wrote:<br>> 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.<br>> <br>> P<br>> <br>> > On Jul 2, 2021, at 8:34 AM, Esteban Zimanyi <<a href="mailto:esteban.zimanyi@ulb.be" target="_blank">esteban.zimanyi@ulb.be</a>> wrote:<br>> > <br>> > Alas MobilityDB only works with PostGIS 2.5. It was never possible to upgrade to version 3 since liblwgeom.h is not exported anymore.<br>> > <br>> > On Fri, Jul 2, 2021, 17:23 Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</a>> wrote:<br>> > <br>> > <br>> > > On Jun 25, 2021, at 2:38 AM, Esteban Zimanyi <<a href="mailto:ezimanyi@ulb.ac.be" target="_blank">ezimanyi@ulb.ac.be</a>> wrote:<br>> > > <br>> > > Now that our user base has considerably increased, we are continuously receiving the same question "What about PostGIS 3.1 support?"<br>> > > <br>> > <br>> > 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?<br>> > <br>> > P.<br>> > _______________________________________________<br>> > postgis-devel mailing list<br>> > <a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>> > <a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br>> > _______________________________________________<br>> > postgis-devel mailing list<br>> > <a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>> > <a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br>> <br>> _______________________________________________<br>> postgis-devel mailing list<br>> <a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br>> _______________________________________________<br>> postgis-devel mailing list<br>> <a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br><br>_______________________________________________<br>postgis-devel mailing list<br><a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><u></u><u></u></p></blockquote></div></div></div></div>_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Darafei "Komяpa" Praliaskouski<br>OSM BY Team - <a href="http://openstreetmap.by/" target="_blank">http://openstreetmap.by/</a><br></div></div>