[postgis-devel] Developing External Functions Using PostGIS Types with postgis-devel

Adam Dadvar adam.dadvar at gmail.com
Mon Mar 25 04:06:41 PDT 2019


Hi All,

I have been trying to develop a separate function that builds on top of the
PostGIS types. Effectively what I'm trying to do is use MultiLineStrings as
a network to compute a minimum spanning tree. The end of each line is a
node in this case.
I think I have a basic understanding of how your code-base works but I am
having issues where functions that I think should be available in
postgis-devel are not.

I know that liblwgeom.h is included in the postgis-devel library which
provides the basic types and some utility functions, but for example, I
want to input a MultiLineString (LWMLINE in the C code) so I use
PG_GETARG_GSERIALIZED_P(0), but this is not included in liblwgeom.h. For
that I can write my own function that does that from PG_DETOAST_DATUM, but
for other functions it gets much more complicated - in order to convert the
GSERIALIZED object I can either write my own function (which would take a
long time) or just use the lwgeom_from_gserialized function that has
already been written, however this function is not included in
postgis-devel and has a large number of dependencies.

I could just copy all of the header files from the source code and include
them in my file but I'd prefer to just be able to say that the file depends
on postgis-devel and then it can be compiled (this file needs to be rolled
out to AWS in future).

I understand that the recommendation might just be to produce the MST
function within the PostGIS code-base, which I'd be open to do. It just
seems strange that the postgis-devel library is basically unusable if you
want to use it to extend PostGIS. Does anyone have any pointers on how to
proceed?

All advice is appreciated,
Adam Dadvar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20190325/86c7acb5/attachment.html>


More information about the postgis-devel mailing list