Book Image

PostGIS Cookbook

Book Image

PostGIS Cookbook

Overview of this book

Table of Contents (18 chapters)
PostGIS Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using external scripts to embed new functionality in order to calculate a Voronoi diagram


PostgreSQL provides a variety of ways to embed functionality that otherwise is not native to either the database or the database extensions in use.

In our case, for the purposes of this recipe, we are interested in applying a space-filling technique called a Voronoi diagram. The following screenshot shows a Voronoi diagram generated from a set of address points. Note how the points from which the diagram was generated are equidistant to the lines that divide them. Packed soap bubbles viewed from above form a similar network of shapes.

Voronoi diagrams are a space-filling approach that is useful for a variety of spatial analysis problems. We can use these to create space-filling polygons around points, the edges of which are equidistant from all the surrounding points.

Tip

More information about Voronoi diagrams can be found at the following link:

http://en.wikipedia.org/wiki/Voronoi_diagram

Unfortunately...