From: Regina Obe Date: Sat, 19 Dec 2015 06:53:12 +0000 (+0000) Subject: Add examples for ST_Voronoi X-Git-Tag: 2.3.0beta1~318 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80f6b18da7761e944d4b1b8902b47473a2e16246;p=postgis Add examples for ST_Voronoi references #2259 git-svn-id: http://svn.osgeo.org/postgis/trunk@14505 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in index 306fe542b..2e9bde714 100644 --- a/doc/html/image_src/Makefile.in +++ b/doc/html/image_src/Makefile.in @@ -131,6 +131,9 @@ IMAGES= \ ../images/st_touches04.png \ ../images/st_touches05.png \ ../images/st_touches06.png \ + ../images/st_voronoi01.png \ + ../images/st_voronoi02.png \ + ../images/st_voronoi03.png \ ../images/st_within01.png # Images that are created with dimensions 100x100 diff --git a/doc/html/image_src/st_voronoi01.wkt b/doc/html/image_src/st_voronoi01.wkt new file mode 100644 index 000000000..2a45d3e37 --- /dev/null +++ b/doc/html/image_src/st_voronoi01.wkt @@ -0,0 +1,6 @@ +Style1;POLYGON((-110 43.3333333333333,-110 270,100.5 270,59.3478260869565 132.826086956522,36.8181818181818 92.2727272727273,-110 43.3333333333333)) +Style2;POLYGON((55 -90,-110 -90,-110 43.3333333333333,36.8181818181818 92.2727272727273,55 79.2857142857143,55 -90)) +Style3;POLYGON((230 47.5,230 -20.7142857142857,55 79.2857142857143,36.8181818181818 92.2727272727273,59.3478260869565 132.826086956522,230 47.5)) +Style4;POLYGON((230 -20.7142857142857,230 -90,55 -90,55 79.2857142857143,230 -20.7142857142857)) +Style5;POLYGON((100.5 270,230 270,230 47.5,59.3478260869565 132.826086956522,100.5 270)) +Style1-thinline;MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120) diff --git a/doc/html/image_src/st_voronoi02.wkt b/doc/html/image_src/st_voronoi02.wkt new file mode 100644 index 000000000..53863aa45 --- /dev/null +++ b/doc/html/image_src/st_voronoi02.wkt @@ -0,0 +1,4 @@ +Style1;POLYGON((-110 43.3333333333333,-110 270,135.555555555556 270,36.8181818181818 92.2727272727273,-110 43.3333333333333)) +Style2;POLYGON((135.555555555556 270,230 270,230 -45.7142857142858,36.8181818181818 92.2727272727273,135.555555555556 270)) +Style3;POLYGON((230 -45.7142857142858,230 -90,-110 -90,-110 43.3333333333333,36.8181818181818 92.2727272727273,230 -45.7142857142858)) +Style1-thinline;MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120) diff --git a/doc/html/image_src/st_voronoi03.wkt b/doc/html/image_src/st_voronoi03.wkt new file mode 100644 index 000000000..e076e44a2 --- /dev/null +++ b/doc/html/image_src/st_voronoi03.wkt @@ -0,0 +1,4 @@ +Style1;LINESTRING(135.555555555556 270,36.8181818181818 92.2727272727273) +Style2;LINESTRING(36.8181818181818 92.2727272727273,-110 43.3333333333333) +Style3;LINESTRING(230 -45.7142857142858,36.8181818181818 92.2727272727273) +Style1-thinline;MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120) diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml index 712b3218b..2b1e168a1 100644 --- a/doc/reference_processing.xml +++ b/doc/reference_processing.xml @@ -3618,7 +3618,7 @@ GEOMETRYCOLLECTION(LINESTRING(6 6,7 7)) Description - ST_Voronoi computes a two-dimensional Voronoi diagram from the vertices of + ST_Voronoi computes a two-dimensional Voronoi diagram from the vertices of the supplied geometry. By default, the result will be a GeometryCollection of Polygons that covers an envelope larger than the extent of the input vertices. @@ -3642,6 +3642,74 @@ GEOMETRYCOLLECTION(LINESTRING(6 6,7 7)) Availability: 2.3.0 - requires GEOS >= 3.5.0. + + + + Examples + + + + + + + + + + + Points overlaid on top of voronoi diagram + + + SELECT + ST_Voronoi(geom) As geom +FROM (SELECT 'MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)'::geometry As geom ) As g; + -- ST_AsText output +GEOMETRYCOLLECTION(POLYGON((-110 43.3333333333333,-110 270,100.5 270,59.3478260869565 132.826086956522,36.8181818181818 92.2727272727273,-110 43.3333333333333)), +POLYGON((55 -90,-110 -90,-110 43.3333333333333,36.8181818181818 92.2727272727273,55 79.2857142857143,55 -90)), +POLYGON((230 47.5,230 -20.7142857142857,55 79.2857142857143,36.8181818181818 92.2727272727273,59.3478260869565 132.826086956522,230 47.5)),POLYGON((230 -20.7142857142857,230 -90,55 -90,55 79.2857142857143,230 -20.7142857142857)), +POLYGON((100.5 270,230 270,230 47.5,59.3478260869565 132.826086956522,100.5 270))) + + + + + + + + + + + Voronoi with tolerance of 30 units + + + SELECT ST_Voronoi(geom, null,30) As geom +FROM (SELECT 'MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)'::geometry As geom ) As g; + -- ST_AsText output +GEOMETRYCOLLECTION(POLYGON((-110 43.3333333333333,-110 270,100.5 270,59.3478260869565 132.826086956522,36.8181818181818 92.2727272727273,-110 43.3333333333333)), +POLYGON((230 47.5,230 -45.7142857142858,36.8181818181818 92.2727272727273,59.3478260869565 132.826086956522,230 47.5)),POLYGON((230 -45.7142857142858,230 -90,-110 -90,-110 43.3333333333333,36.8181818181818 92.2727272727273,230 -45.7142857142858)), +POLYGON((100.5 270,230 270,230 47.5,59.3478260869565 132.826086956522,100.5 270))) + + + + + + + + + + Voronoi with tolerance of 30 units as multilinestring + + + SELECT ST_Voronoi(geom, null,30,false) As geom +FROM (SELECT 'MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)'::geometry As geom ) As g + -- ST_AsText output +MULTILINESTRING((135.555555555556 270,36.8181818181818 92.2727272727273),(36.8181818181818 92.2727272727273,-110 43.3333333333333),(230 -45.7142857142858,36.8181818181818 92.2727272727273)) + + + + + + + +