[postgis-tickets] [SCM] PostGIS branch master updated. 3.4.0beta1-27-gfa5525813

git at osgeo.org git at osgeo.org
Tue Jul 18 17:05:13 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  fa5525813fade6d6a3c21a849ea4d6552780e3c4 (commit)
      from  b11813d38bee05eaa3351376e4453c72becf21d3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fa5525813fade6d6a3c21a849ea4d6552780e3c4
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Tue Jul 18 17:05:06 2023 -0700

    Improve doc for ST_BuildArea

diff --git a/doc/html/images/Makefile.in b/doc/html/images/Makefile.in
index 871d7fcd9..8a268e0e6 100644
--- a/doc/html/images/Makefile.in
+++ b/doc/html/images/Makefile.in
@@ -61,6 +61,8 @@ GENERATED_IMAGES= \
 	st_buffer12.png \
 	st_buffer13.png \
 	st_buildarea01.png \
+	st_buildarea02.png \
+	st_buildarea03.png \
 	st_closestpoint01.png \
 	st_closestpoint02.png \
 	st_clusterkmeans02.png \
diff --git a/doc/html/images/wkt/st_buildarea02.wkt b/doc/html/images/wkt/st_buildarea02.wkt
new file mode 100644
index 000000000..f2522563d
--- /dev/null
+++ b/doc/html/images/wkt/st_buildarea02.wkt
@@ -0,0 +1 @@
+ArgA-endpoints;MULTILINESTRING ((180 40, 30 20, 20 90), (180 40, 160 160), (160 160, 80 190, 80 120, 20 90), (80 60, 120 130, 150 80), (80 60, 150 80))
diff --git a/doc/html/images/wkt/st_buildarea03.wkt b/doc/html/images/wkt/st_buildarea03.wkt
new file mode 100644
index 000000000..4e56f0dab
--- /dev/null
+++ b/doc/html/images/wkt/st_buildarea03.wkt
@@ -0,0 +1 @@
+Result;POLYGON ((180 40, 30 20, 20 90, 80 120, 80 190, 160 160, 180 40), (150 80, 120 130, 80 60, 150 80))
diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml
index 1cab2944d..3f266142a 100644
--- a/doc/reference_processing.xml
+++ b/doc/reference_processing.xml
@@ -403,10 +403,20 @@ POLYGON((236057.59057465 900908.759918696,236028.301252769 900838.049240578,235
             The result is a Polygon or MultiPolygon, depending on input.
             If the input linework does not form polygons, NULL is returned.
             </para>
-            <para>This function assumes all inner geometries represent holes</para>
+            <para>Unlike <xref linkend="ST_MakePolygon" />,
+            this function accepts rings formed by multiple lines, and can form any number of polygons.
+            </para>
+            <para>This function assumes all inner geometries represent holes.
+            To turn inner geometries into polygons as well, see <xref linkend="ST_Polygonize" />.
+            </para>
 
             <note>
-                <para>Input linework must be correctly noded for this function to work properly</para>
+                <para>Input linework must be correctly noded for this function to work properly.
+                <xref linkend="ST_Node" /> can be used to node lines.
+                </para>
+                <para>If the input linework crosses, this function will produce invalid polygons.
+                <xref linkend="ST_MakeValid" /> can be used to ensure the output is valid.
+                </para>
             </note>
 
             <para role="availability" conformance="1.1.0">Availability: 1.1.0</para>
@@ -414,48 +424,77 @@ POLYGON((236057.59057465 900908.759918696,236028.301252769 900838.049240578,235
 
           <refsection>
             <title>Examples</title>
-            <informaltable>
-                  <tgroup cols="1">
-                    <tbody>
-                      <row>
-                        <entry><para><informalfigure>
-                            <mediaobject>
-                              <imageobject>
-                                <imagedata fileref="images/st_buildarea01.png" />
-                              </imageobject>
-                              <caption><para>These will create a donut</para></caption>
-                            </mediaobject>
-                          </informalfigure>
-                <programlisting>
-<lineannotation>using polygons</lineannotation>
+
+                <informaltable>
+      <tgroup cols="2">
+      <tbody>
+        <row>
+        <entry><para>
+        <informalfigure>
+          <mediaobject>
+              <imageobject>
+              <imagedata fileref="images/st_buildarea02.png" />
+              </imageobject>
+              <caption><para>Input lines</para></caption>
+          </mediaobject>
+        </informalfigure>
+        </para></entry>
+        <entry><para>
+        <informalfigure>
+          <mediaobject>
+              <imageobject>
+              <imagedata fileref="images/st_buildarea03.png" />
+              </imageobject>
+              <caption><para>Area result</para></caption>
+          </mediaobject>
+        </informalfigure>
+        </para></entry>
+       </row>
+      </tbody>
+      </tgroup>
+    </informaltable>
+
+      <programlisting>WITH data(geom) AS (VALUES
+   ('LINESTRING (180 40, 30 20, 20 90)'::geometry)
+  ,('LINESTRING (180 40, 160 160)'::geometry)
+  ,('LINESTRING (160 160, 80 190, 80 120, 20 90)'::geometry)
+  ,('LINESTRING (80 60, 120 130, 150 80)'::geometry)
+  ,('LINESTRING (80 60, 150 80)'::geometry)
+)
+SELECT ST_AsText( ST_BuildArea( ST_Collect( geom )))
+    FROM data;
+    
+  ------------------------------------------------------------------------------------------
+ POLYGON((180 40,30 20,20 90,80 120,80 190,160 160,180 40),(150 80,120 130,80 60,150 80))
+</programlisting>
+
+    <informalfigure>
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="images/st_buildarea01.png" />
+          </imageobject>
+          <caption><para>Create a donut from two circular polygons</para></caption>
+        </mediaobject>
+      </informalfigure>
+<programlisting>
 SELECT ST_BuildArea(ST_Collect(smallc,bigc))
 FROM (SELECT
     ST_Buffer(
       ST_GeomFromText('POINT(100 90)'), 25) As smallc,
     ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As bigc) As foo;
-                </programlisting>
+</programlisting>
 
-                <programlisting>
-<lineannotation>using linestrings</lineannotation>
-SELECT ST_BuildArea(ST_Collect(smallc,bigc))
-FROM (SELECT
-    ST_ExteriorRing(ST_Buffer(
-      ST_GeomFromText('POINT(100 90)'), 25)) As smallc,
-    ST_ExteriorRing(ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50)) As bigc) As foo;</programlisting>
-                          </para></entry>
-                    </row>
-                    </tbody>
-                  </tgroup>
-            </informaltable>
           </refsection>
 
           <refsection>
             <title>See Also</title>
 
             <para>
-            <xref linkend="ST_Node" />,
+            <xref linkend="ST_Collect" />,
             <xref linkend="ST_MakePolygon" />,
             <xref linkend="ST_MakeValid" />,
+            <xref linkend="ST_Node" />,
+            <xref linkend="ST_Polygonize" />,
             <xref linkend="ST_BdPolyFromText" />,
             <xref linkend="ST_BdMPolyFromText" /> (wrappers to
             this function with standard OGC interface)</para>

-----------------------------------------------------------------------

Summary of changes:
 doc/html/images/Makefile.in            |  2 +
 doc/html/images/wkt/st_buildarea02.wkt |  1 +
 doc/html/images/wkt/st_buildarea03.wkt |  1 +
 doc/reference_processing.xml           | 99 +++++++++++++++++++++++-----------
 4 files changed, 73 insertions(+), 30 deletions(-)
 create mode 100644 doc/html/images/wkt/st_buildarea02.wkt
 create mode 100644 doc/html/images/wkt/st_buildarea03.wkt


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list