[postgis-users] Has anyone got novel Python function example

Imre Samu pella.samu at gmail.com
Sat Dec 3 20:10:15 PST 2022

> It will be interesting to see novel Python functions in PostGIS.

Server side?

1. Postgis Raster  see
  "11.3.4. Use PLPython to dump out images via SQL"

2.) book:   "PostGIS-Cookbook"
 - "Writing PostGIS functions with PL/Python"

 -  "Geocoding with geopy and PL/Python"


3.) The plpygis has some simple examples:
"plpygis is a Python conveter to and from the PostGIS geometry type, WKB,
EWKB, GeoJSON and Shapely geometries and additionally supports
__geo_interface__. plpygis is intended for use in PL/Python functions."
see more:
-  https://plpygis.readthedocs.io/en/latest/
-  https://github.com/bosth/plpygis
-  slide ( 2017 )

4.)  CartoDB is also plpythonu based.
- https://github.com/search?q=repo%3ACartoDB%2Fcartodb+plpython&type=code
- crankshaft ( CARTO Spatial Analysis extension for PostgreSQL )

5.)  (tutorial) Map Matching in PostGIS with Valhalla and PL/Python

6.) Apache MADlib ( Graph, Deep learning, Statistics,  .. )
https://madlib.apache.org/docs/latest/index.html   ( mostly plpythonu based


Be careful:
*"PL/Python is only available as an “untrusted” language, meaning it does
not offer any way of restricting what users can do in it and is therefore
named plpython3u. A trusted variant plpython might become available in the
future if a secure execution mechanism is developed in Python. The writer
of a function in untrusted PL/Python must take care that the function
cannot be used to do anything unwanted, since it will be able to do
anything that could be done by a user logged in as the database
administrator. Only superusers can create functions in untrusted languages
such as plpython3u."*


Shaozhong SHI <shishaozhong at gmail.com> ezt írta (időpont: 2022. dec. 3.,
Szo, 21:59):

> It will be interesting to see novel Python functions in PostGIS.
> Regards,
> David
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20221204/c8b6db45/attachment.htm>

More information about the postgis-users mailing list