Skip to Content
PostGIS Cookbook - Second Edition
book

PostGIS Cookbook - Second Edition

by Stephen Vincent Mather, Pedro Wightman, Bborie Park, Thomas Kraft, Mayra Zurbarán, Paolo Corti
March 2018
Beginner to intermediate content levelBeginner to intermediate
584 pages
14h 31m
English
Packt Publishing
Content preview from PostGIS Cookbook - Second Edition

How to do it...

In order to perform the basic skeletonization, we'll calculate the Voronoi polygons on the nodes that make up the original stream polygon. By default, the edges of the Voronoi polygons find the line that demarcates the midpoint between points. We will leverage this tendency by treating our lines like points—adding extra points to the lines and then converting the lines to a point set. This approach, in combination with the Voronoi approach, will provide an initial estimate of the polygon's centerline.

We will add extra points to our input geometries using the ST_Segmentize function and then convert the geometries to points using ST_DumpPoints:

CREATE TABLE chp06.voronoi_points AS(
  SELECT (ST_DumpPoints(ST_Segmentize(the_geom, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL 13 Cookbook

PostgreSQL 13 Cookbook

Vallarapu Naga Avinash Kumar
PostgreSQL High Performance Cookbook

PostgreSQL High Performance Cookbook

Dinesh Kumar, Chitij Chauhan
Mastering PostGIS

Mastering PostGIS

Dominik Mikiewicz, Michal Mackiewicz, Tomasz Nycz

Publisher Resources

ISBN: 9781788299329Supplemental Content