O'Reilly logo

PostGIS Cookbook by Bborie Park, Stephen Vincent Mather, Thomas J. Kraft, Paolo Corti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using external scripts to embed other libraries in order to calculate a Voronoi diagram – advanced

While the previous recipe works fine for typical cases, faster approaches are available. Rather than functions built into Python, we can leverage Python libraries that are wrappers for compiled C++ code, resulting in an order-of-magnitude improvement in speed. The price we pay is writing a function to embed the faster functionality. This price is a one-time cost of thought and consideration and well worth the pay off for faster computation that will be, in some cases, orders-of-magnitude faster than our native Python function.

In addition, the pattern we will be using, that is, passing data from PostGIS to an external package and returning information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required