[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha2-83-ga1bbe50

git at osgeo.org git at osgeo.org
Tue Oct 6 16:16:24 PDT 2020


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  a1bbe506f74183b1c3abcd762c37e12dfffe2884 (commit)
      from  963aad2943924702e03b180a82bd1412c0d5880e (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 a1bbe506f74183b1c3abcd762c37e12dfffe2884
Author: Regina Obe <lr at pcorp.us>
Date:   Tue Oct 6 19:16:01 2020 -0400

    So ST_BuildArea ain't what it used to be 10 years ago, but luckily ST_MakeValid does what old ST_BuildArea did, so move examples to ST_MakeValid from ST_BuildArea and party like it's 2010. references #4763

diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in
index 2950271..1c1d404 100644
--- a/doc/html/image_src/Makefile.in
+++ b/doc/html/image_src/Makefile.in
@@ -39,7 +39,6 @@ IMAGES= \
 	../images/st_buffer12.png \
 	../images/st_buffer13.png \
 	../images/st_buildarea01.png \
-	../images/st_buildarea02.png \
 	../images/st_closestpoint01.png \
 	../images/st_closestpoint02.png \
 	../images/st_clusterkmeans01.png \
@@ -104,6 +103,8 @@ IMAGES= \
 	../images/st_longestline01.png \
 	../images/st_longestline02.png \
 	../images/st_longestline03.png \
+	../images/st_makevalid01.png \
+	../images/st_makevalid02.png \
 	../images/st_maximuminscribedcircle01.png \
 	../images/st_maximuminscribedcircle02.png \
 	../images/st_minimumboundingcircle01.png \
diff --git a/doc/html/image_src/st_buildarea02.wkt b/doc/html/image_src/st_makevalid01.wkt
similarity index 100%
rename from doc/html/image_src/st_buildarea02.wkt
rename to doc/html/image_src/st_makevalid01.wkt
diff --git a/doc/html/image_src/st_makevalid02.wkt b/doc/html/image_src/st_makevalid02.wkt
new file mode 100644
index 0000000..2e1c865
--- /dev/null
+++ b/doc/html/image_src/st_makevalid02.wkt
@@ -0,0 +1,2 @@
+Style2;GEOMETRYCOLLECTION(POLYGON((76 20.7142857142857,79 22,91 50,83.5 67.5,101 60,129 72,130.285714285714 75,141 50,129 22,101 10,76 20.7142857142857)),POLYGON((80.2857142857143 75,83.5 67.5,76 70.7142857142857,79 72,80.2857142857143 75)),POLYGON((83.5 82.5,80.2857142857143 75,79 78,76 79.2857142857143,83.5 82.5)),POLYGON((130.285714285714 75,129 78,101 90,83.5 82.5,91 100,83.5 117.5,101 110,129 122,130.285714285714 125,141 100,130.285714285714 75)),POLYGON((80.2857142857143 125,83.5 117.5,76 120.714285714286,79 122,80.2857142857143 125)),POLYGON((83.5 132.5,80.2857142857143 125,79 128,76 129.285714285714,83.5 132.5)),POLYGON((130.285714285714 125,129 128,101 140,83.5 132.5,91 150,79 178,76 179.285714285714,101 190,129 178,141 150,130.285714285714 125)),POLYGON((76 20.7142857142857,51 10,23 22,11 50,21.7142857142857 75,23 72,51 60,68.5 67.5,61 50,73 22,76 20.7142857142857)),POLYGON((76 70.7142857142857,68.5 67.5,71.7142857142857 75,73 72,76 70.7142857142857)),POLYGON((76 79.285714
 2857143,73 78,71.7142857142857 75,68.5 82.5,76 79.2857142857143)),POLYGON((68.5 82.5,51 90,23 78,21.7142857142857 75,11 100,21.7142857142857 125,23 122,51 110,68.5 117.5,61 100,68.5 82.5)),POLYGON((76 120.714285714286,68.5 117.5,71.7142857142857 125,73 122,76 120.714285714286)),POLYGON((76 129.285714285714,73 128,71.7142857142857 125,68.5 132.5,76 129.285714285714)),POLYGON((68.5 132.5,51 140,23 128,21.7142857142857 125,11 150,23 178,51 190,76 179.285714285714,73 178,61 150,68.5 132.5)))
+Style1-thinline;LINESTRING(23 22,129 178)
diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml
index 0859046..693b265 100644
--- a/doc/reference_measure.xml
+++ b/doc/reference_measure.xml
@@ -1300,7 +1300,7 @@ LINESTRING(20 40,121.111404660392 186.629392246051)
 SELECT ST_AsText(ST_LongestLine(c.the_geom, c.the_geom)) As llinewkt,
 	ST_MaxDistance(c.the_geom,c.the_geom) As max_dist,
 	ST_Length(ST_LongestLine(c.the_geom, c.the_geom)) As lenll
-FROM (SELECT ST_BuildArea(ST_Collect(the_geom)) As the_geom
+FROM (SELECT ST_MakeValid(ST_Collect(the_geom)) As the_geom
 	FROM (SELECT ST_Translate(ST_SnapToGrid(ST_Buffer(ST_Point(50 ,generate_series(50,190, 50)
 			),40, 'quad_segs=2'),1), x, 0)  As the_geom
 			FROM generate_series(1,100,50) As x)  AS foo
@@ -1320,7 +1320,7 @@ FROM (SELECT ST_BuildArea(ST_Collect(the_geom)) As the_geom
 	  <refsection>
 		<title>See Also</title>
 
-		<para><xref linkend="ST_MaxDistance"/>, <xref linkend="ST_ShortestLine"/>, <xref linkend="ST_3DLongestLine"/></para>
+		<para><xref linkend="ST_MaxDistance"/>, <xref linkend="ST_MakeValid"/>, <xref linkend="ST_ShortestLine"/>, <xref linkend="ST_3DLongestLine"/></para>
 	  </refsection>
 	</refentry>
 
diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml
index 024ab31..930db1d 100644
--- a/doc/reference_processing.xml
+++ b/doc/reference_processing.xml
@@ -400,48 +400,25 @@ POLYGON((236057.59057465 900908.759918696,236028.301252769 900838.049240578,235
                               <imageobject>
                                 <imagedata fileref="images/st_buildarea01.png" />
                               </imageobject>
-                              <caption><para>This will create a donut</para></caption>
+                              <caption><para>These will create a donut</para></caption>
                             </mediaobject>
                           </informalfigure>
-                <programlisting>
+                <programlisting>--using polygons
 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>--using linestrings
+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>
-                    <row>
-                        <entry><para><informalfigure>
-                            <mediaobject>
-                              <imageobject>
-                                <imagedata fileref="images/st_buildarea02.png" />
-                              </imageobject>
-                              <caption><para>This will create a gaping hole inside the circle with prongs sticking out</para></caption>
-                            </mediaobject>
-                          </informalfigure>
-                <programlisting>
-SELECT ST_BuildArea(ST_Collect(line,circle))
-FROM (SELECT
-    ST_Buffer(
-        ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)),
-                5)  As line,
-    ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;
-
---this creates the same gaping hole
---but using linestrings instead of polygons
-SELECT ST_BuildArea(
-    ST_Collect(ST_ExteriorRing(line),ST_ExteriorRing(circle))
-    )
-FROM (SELECT ST_Buffer(
-    ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190))
-        ,5)  As line,
-    ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;
-
-                </programlisting>
-                        </para></entry>
-                      </row>
                     </tbody>
                   </tgroup>
             </informaltable>
@@ -453,6 +430,7 @@ FROM (SELECT ST_Buffer(
             <para>
             <xref linkend="ST_Node" />,
             <xref linkend="ST_MakePolygon" />,
+            <xref linkend="ST_MakeValid" />,
             <xref linkend="ST_BdPolyFromText" />,
             <xref linkend="ST_BdMPolyFromText" />wrappers to
             this function with standard OGC interface</para>
@@ -1866,11 +1844,64 @@ FROM (SELECT ST_Translate(ST_Force3D(ST_Boundary(ST_Buffer(ST_Point(1,3), 2,2)))
     <para>&Z_support;</para>
 
           </refsection>
-
+          <refsection>
+            <title>Examples</title>
+            <informaltable>
+                  <tgroup cols="1">
+                    <tbody>
+                    <row>
+                        <entry><para><informalfigure>
+                            <mediaobject>
+                              <imageobject>
+                                <imagedata fileref="images/st_makevalid01.png" />
+                              </imageobject>
+                              <caption><para>This will create a valid multipolygon noded which looks like a circle with a prong.</para>
+                              <para>Note: ST_Collect simply collects all the polygons into an invalid MULTIPOLYGON because the polygons overlap.  Use ST_MakeValid to convert to a valid multipolygon.</para>
+                              </caption>
+                            </mediaobject>
+                          </informalfigure>
+                <programlisting>
+SELECT ST_MakeValid( ST_Collect(line,circle) )
+FROM (SELECT
+    ST_Buffer(
+        ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)),
+                5)  As line,
+    ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;
+                </programlisting>
+            </para>
+            </entry>
+        </row>
+        <row>
+            <entry><para><informalfigure>
+                <mediaobject>
+                    <imageobject>
+                    <imagedata fileref="images/st_makevalid02.png" />
+                    </imageobject>
+                    <caption><para>This will create a valid multipolygon from overlapping collection of polygons.</para>
+                    <para>Note: ST_Collect simply collects all the polygons into an invalid MULTIPOLYGON because the polygons overlap.  Use ST_MakeValid to convert to a valid multipolygon if you want to maintain boundaries.</para>
+                    </caption>
+                </mediaobject>
+                </informalfigure>
+    <programlisting>
+SELECT ST_MakeValid( ST_Collect(line,circle) )
+FROM (SELECT
+ST_Buffer(
+ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)),
+    5)  As line,
+ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;
+    </programlisting>
+</para>
+</entry>
+        </row>
+    </tbody>
+    </tgroup>
+</informaltable>
+</refsection>
           <refsection>
             <title>See Also</title>
             <para>
-                <xref linkend="ST_IsValid" />
+                <xref linkend="ST_IsValid" />,
+                <xref linkend="ST_Collect" />,
                 <xref linkend="ST_CollectionExtract" />
             </para>
           </refsection>

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

Summary of changes:
 doc/html/image_src/Makefile.in                     |  3 +-
 .../{st_buildarea02.wkt => st_makevalid01.wkt}     |  0
 .../{st_longestline03.wkt => st_makevalid02.wkt}   |  0
 doc/reference_measure.xml                          |  4 +-
 doc/reference_processing.xml                       | 99 ++++++++++++++--------
 5 files changed, 69 insertions(+), 37 deletions(-)
 rename doc/html/image_src/{st_buildarea02.wkt => st_makevalid01.wkt} (100%)
 copy doc/html/image_src/{st_longestline03.wkt => st_makevalid02.wkt} (100%)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list