[postgis-devel] Making SFCGAL mandatory

Hugo Mercier hugo.mercier at oslandia.com
Wed Nov 14 06:03:04 PST 2018



On 14/11/2018 14:45, Darafei "Komяpa" Praliaskouski wrote:
>     If I understand correctly, it would help to have something like a
>     postgis_sfcgal.so as an optional library that brings SFCGAL
>     functionalities rather than having only one postgis.so with or without
>     SFCGAL in it ?
> 
>     I am pretty sure there is a way to make the backend switch more
>     "dynamic" and work with a separate library, but I would have to dig a
>     bit deeper.
> 
> 
> It would be beneficial. Right now there's no mechanism for third party
> to bring in a replacement for PostGIS functions and get them selected in
> postgis.backend GUC - the way it is done now is by providing a
> compile-time list in postgis.so that will somehow delegate to one or
> other function.

Thanks for the confirmation.

So basically, we would only change the way functions in SFCGAL
"register" themselves in the global array of functions [1]: transform
the static array into a simple chained list and have the SFCGAL module
extend it when it gets loaded on runtime by postgresql (on create
extension postgis_sfcgal)

[1]
https://trac.osgeo.org/postgis/browser/trunk/postgis/lwgeom_backend_api.c#L71

> 
> If someone provides a javascript implementation for say
> ST_DelaunayTriangles, they can't simply drop into it at all, apart from
> renaming and wrapping it all into more layers and having strong
> dependencies on creation order.

Hmmm, but that's even more dynamic than what I had in mind :)

What you suggest is a way to override any function of postgis with any
other user-defined function, including from interpreted languages, and
only for the current session ?

It would mean to expose all the internal details of the "backend
switch". I don't know ...


More information about the postgis-devel mailing list