]> granicus.if.org Git - postgis/commitdiff
Add examples for ST_Voronoi
authorRegina Obe <lr@pcorp.us>
Sat, 19 Dec 2015 06:53:12 +0000 (06:53 +0000)
committerRegina Obe <lr@pcorp.us>
Sat, 19 Dec 2015 06:53:12 +0000 (06:53 +0000)
references #2259

git-svn-id: http://svn.osgeo.org/postgis/trunk@14505 b70326c6-7e19-0410-871a-916f4a2858ee

doc/html/image_src/Makefile.in
doc/html/image_src/st_voronoi01.wkt [new file with mode: 0644]
doc/html/image_src/st_voronoi02.wkt [new file with mode: 0644]
doc/html/image_src/st_voronoi03.wkt [new file with mode: 0644]
doc/reference_processing.xml

index 306fe542bb8dd7436a1f5170bc02114b730d27b6..2e9bde714500e13c11a3dde885cf180cccaa609a 100644 (file)
@@ -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 (file)
index 0000000..2a45d3e
--- /dev/null
@@ -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))\r
+Style2;POLYGON((55 -90,-110 -90,-110 43.3333333333333,36.8181818181818 92.2727272727273,55 79.2857142857143,55 -90))\r
+Style3;POLYGON((230 47.5,230 -20.7142857142857,55 79.2857142857143,36.8181818181818 92.2727272727273,59.3478260869565 132.826086956522,230 47.5))\r
+Style4;POLYGON((230 -20.7142857142857,230 -90,55 -90,55 79.2857142857143,230 -20.7142857142857))\r
+Style5;POLYGON((100.5 270,230 270,230 47.5,59.3478260869565 132.826086956522,100.5 270))\r
+Style1-thinline;MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)\r
diff --git a/doc/html/image_src/st_voronoi02.wkt b/doc/html/image_src/st_voronoi02.wkt
new file mode 100644 (file)
index 0000000..53863aa
--- /dev/null
@@ -0,0 +1,4 @@
+Style1;POLYGON((-110 43.3333333333333,-110 270,135.555555555556 270,36.8181818181818 92.2727272727273,-110 43.3333333333333))\r
+Style2;POLYGON((135.555555555556 270,230 270,230 -45.7142857142858,36.8181818181818 92.2727272727273,135.555555555556 270))\r
+Style3;POLYGON((230 -45.7142857142858,230 -90,-110 -90,-110 43.3333333333333,36.8181818181818 92.2727272727273,230 -45.7142857142858))\r
+Style1-thinline;MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)\r
diff --git a/doc/html/image_src/st_voronoi03.wkt b/doc/html/image_src/st_voronoi03.wkt
new file mode 100644 (file)
index 0000000..e076e44
--- /dev/null
@@ -0,0 +1,4 @@
+Style1;LINESTRING(135.555555555556 270,36.8181818181818 92.2727272727273)\r
+Style2;LINESTRING(36.8181818181818 92.2727272727273,-110 43.3333333333333)\r
+Style3;LINESTRING(230 -45.7142857142858,36.8181818181818 92.2727272727273)\r
+Style1-thinline;MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)\r
index 712b3218ba9f4db18b5fa14839dbeb4ee44f9ca6..2b1e168a1483604cb639da789a4f1cb40470c9c2 100644 (file)
@@ -3618,7 +3618,7 @@ GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
                <title>Description</title>
 
                <para>
-                       ST_Voronoi computes a two-dimensional Voronoi diagram from the vertices of 
+                       ST_Voronoi computes a two-dimensional <ulink url="https://en.wikipedia.org/wiki/Voronoi_diagram">Voronoi diagram</ulink> 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.
                </para> 
@@ -3642,6 +3642,74 @@ GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
 
                <para>Availability: 2.3.0 - requires GEOS &gt;= 3.5.0.</para>
          </refsection>
+         
+         <!-- Examples -->
+         <refsection>
+               <title>Examples</title>
+               <informaltable>
+                 <tgroup cols="1">
+                       <tbody>
+                         <row>
+                               <entry>
+                                       <para><informalfigure>
+                                       <mediaobject>
+                                         <imageobject>
+                                               <imagedata fileref="images/st_voronoi01.png" />
+                                         </imageobject>
+                                         <caption><para>Points overlaid on top of voronoi diagram</para></caption>
+                                       </mediaobject>
+                                       </informalfigure>
+                                       <programlisting>SELECT 
+       ST_Voronoi(geom) As geom
+FROM (SELECT 'MULTIPOINT (50 30, 60 30, 100 100,10 150, 110 120)'::geometry As geom ) As g;</programlisting>
+<screen> -- 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)))
+</screen>
+                                       </para>
+                               </entry>
+                       </row>
+                       <row>   
+                               <entry><para><informalfigure>
+                                       <mediaobject>
+                                         <imageobject>
+                                               <imagedata fileref="images/st_voronoi02.png" />
+                                         </imageobject>
+                                         <caption><para>Voronoi with tolerance of 30 units</para></caption>
+                                       </mediaobject>
+                                 </informalfigure>
+                                       <programlisting>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;</programlisting>
+<screen> -- 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)))
+</screen>
+                               </para></entry>
+                         </row>
+                        <row>  
+                               <entry><para><informalfigure>
+                                       <mediaobject>
+                                         <imageobject>
+                                               <imagedata fileref="images/st_voronoi03.png" />
+                                         </imageobject>
+                                         <caption><para>Voronoi with tolerance of 30 units as multilinestring</para></caption>
+                                       </mediaobject>
+                                 </informalfigure>
+                                       <programlisting>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</programlisting>
+<screen> -- 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))
+</screen>
+                               </para></entry>
+                         </row>
+               </tbody>
+               </tgroup>
+               </informaltable>
+
+         </refsection>
 
          <!-- Optionally add a "See Also" section -->
          <refsection>