[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-507-g1052dfb9f

git at osgeo.org git at osgeo.org
Mon Feb 7 14:19:15 PST 2022


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  1052dfb9f689a8cca8ba038a00bf9377846df1cb (commit)
      from  41b5824dabca28364a4e822c42123042a9329edb (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 1052dfb9f689a8cca8ba038a00bf9377846df1cb
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Mon Feb 7 14:19:10 2022 -0800

    Add doc ST_PointOnSurface images

diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in
index fb4bf5cb2..0ac0a1359 100644
--- a/doc/html/image_src/Makefile.in
+++ b/doc/html/image_src/Makefile.in
@@ -128,6 +128,11 @@ IMAGES= \
 	../images/st_overlaps04.png \
 	../images/st_overlaps05.png \
 	../images/st_overlaps06.png \
+	../images/st_pointonsurface.png \
+	../images/st_pointonsurface01.png \
+	../images/st_pointonsurface02.png \
+	../images/st_pointonsurface03.png \
+	../images/st_pointonsurface04.png \
 	../images/st_sharedpaths01.png \
 	../images/st_sharedpaths02.png \
 	../images/st_shortestline01.png \
diff --git a/doc/html/image_src/st_pointonsurface.wkt b/doc/html/image_src/st_pointonsurface.wkt
new file mode 100644
index 000000000..9d3d39c64
--- /dev/null
+++ b/doc/html/image_src/st_pointonsurface.wkt
@@ -0,0 +1,3 @@
+ArgA;POLYGON ((130 120, 120 190, 30 140, 50 20, 190 20, 170 100, 90 60, 90 130, 130 120))
+ArgB;POINT(100.18264840182648 85.11415525114155)
+Result;POINT(62.5 110)
diff --git a/doc/html/image_src/st_pointonsurface01.wkt b/doc/html/image_src/st_pointonsurface01.wkt
new file mode 100644
index 000000000..31107ae73
--- /dev/null
+++ b/doc/html/image_src/st_pointonsurface01.wkt
@@ -0,0 +1,2 @@
+ArgA;MULTIPOINT ( 8 24, 10 92, 12 154, 17 68, 28 10, 29 52, 29 84, 55 50, 56 24, 131 14, 160 180, 189 180 )
+Result;POINT (55 50)
diff --git a/doc/html/image_src/st_pointonsurface02.wkt b/doc/html/image_src/st_pointonsurface02.wkt
new file mode 100644
index 000000000..3f90ea9d8
--- /dev/null
+++ b/doc/html/image_src/st_pointonsurface02.wkt
@@ -0,0 +1,2 @@
+ArgA;LINESTRING ( 190 160, 10 190, 40 90, 20 70, 10 10, 30 40, 30 10, 110 40, 70 10, 110 10, 140 40, 140 10, 160 30, 180 10 )
+Result;POINT (40 90)
diff --git a/doc/html/image_src/st_pointonsurface03.wkt b/doc/html/image_src/st_pointonsurface03.wkt
new file mode 100644
index 000000000..56a8ec3b7
--- /dev/null
+++ b/doc/html/image_src/st_pointonsurface03.wkt
@@ -0,0 +1,2 @@
+ArgA;POLYGON (( 190 190, 10 190, 10 10, 190 10, 190 20, 160 30, 60 30, 60 130, 190 140, 190 190 ))
+Result;POINT (35 80)
diff --git a/doc/html/image_src/st_pointonsurface04.wkt b/doc/html/image_src/st_pointonsurface04.wkt
new file mode 100644
index 000000000..2565b4533
--- /dev/null
+++ b/doc/html/image_src/st_pointonsurface04.wkt
@@ -0,0 +1,2 @@
+ArgA;GEOMETRYCOLLECTION ( POLYGON (( 190 170, 180 100, 80 140, 80 160, 130 160, 110 180, 110 190, 180 180, 190 170 )), LINESTRING ( 80 120, 120 20, 140 70, 150 30, 180 50, 190 10 ), MULTIPOINT ( 19 150, 22 49, 30 13, 32 101, 45 35, 67 88, 75 16 ))
+Result;POINT (133.57142857142856 150)
diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml
index 01a87f85c..eacb8d493 100644
--- a/doc/reference_processing.xml
+++ b/doc/reference_processing.xml
@@ -525,7 +525,7 @@ FROM (SELECT
     <refsection>
       <title>Examples</title>
 
-      <para>In the following illustrations the green dot is
+      <para>In the following illustrations the red dot is
       the centroid of the source geometry.</para>
 
       <informaltable>
@@ -1764,26 +1764,101 @@ MULTILINESTRING((164 1,11.7867965644036 1,1 11.7867965644036,1 195),
       <refsection>
         <title>Examples</title>
 
+      <informaltable>
+        <tgroup cols="2">
+          <tbody>
+            <row>
+              <entry><para><informalfigure>
+                  <mediaobject>
+                    <imageobject>
+                      <imagedata fileref="images/st_pointonsurface01.png" />
+                    </imageobject>
+
+                    <caption><para>PointOnSurface of a
+                    <varname>MULTIPOINT</varname></para></caption>
+                  </mediaobject>
+                </informalfigure></para></entry>
+
+              <entry><para><informalfigure>
+                  <mediaobject>
+                    <imageobject>
+                      <imagedata fileref="images/st_pointonsurface02.png" />
+                    </imageobject>
+
+                    <caption><para>PointOnSurface of a
+                    <varname>LINESTRING</varname></para></caption>
+                  </mediaobject>
+                </informalfigure></para></entry>
+            </row>
+
+            <row>
+              <entry><para><informalfigure>
+                  <mediaobject>
+                    <imageobject>
+                      <imagedata fileref="images/st_pointonsurface03.png" />
+                    </imageobject>
+
+                    <caption><para>PointOnSurface of a
+                    <varname>POLYGON</varname></para></caption>
+                  </mediaobject>
+                </informalfigure></para></entry>
+
+              <entry><para><informalfigure>
+                  <mediaobject>
+                    <imageobject>
+                      <imagedata fileref="images/st_pointonsurface04.png" />
+                    </imageobject>
+
+                    <caption><para>PointOnSurface of a
+                    <varname>GEOMETRYCOLLECTION</varname></para></caption>
+                  </mediaobject>
+                </informalfigure></para></entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </informaltable>
+
         <programlisting>SELECT ST_AsText(ST_PointOnSurface('POINT(0 5)'::geometry));
- st_astext
 ------------
  POINT(0 5)
 
 SELECT ST_AsText(ST_PointOnSurface('LINESTRING(0 5, 0 10)'::geometry));
- st_astext
 ------------
  POINT(0 5)
 
 SELECT ST_AsText(ST_PointOnSurface('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'::geometry));
-   st_astext
 ----------------
  POINT(2.5 2.5)
 
 SELECT ST_AsEWKT(ST_PointOnSurface(ST_GeomFromEWKT('LINESTRING(0 5 1, 0 0 1, 0 10 2)')));
-   st_asewkt
 ----------------
  POINT(0 0 1)
 </programlisting>
+
+        <para><emphasis role="bold">Example:</emphasis>
+        The result of ST_PointOnSurface is guaranteed to lie within polygons,
+        whereas the point computed by <xref linkend="ST_Centroid" /> may be outside.
+        </para>
+
+        <informalfigure>
+            <mediaobject>
+                <imageobject>
+                <imagedata fileref="images/st_pointonsurface.png" />
+                </imageobject>
+                <caption><para>Red: point on surface; Green: centroid</para></caption>
+            </mediaobject>
+            </informalfigure>
+
+<programlisting>
+SELECT ST_AsText(ST_PointOnSurface(geom)) AS pt_on_surf,
+       ST_AsText(ST_Centroid(geom)) AS centroid
+    FROM (SELECT 'POLYGON ((130 120, 120 190, 30 140, 50 20, 190 20,
+                      170 100, 90 60, 90 130, 130 120))'::geometry AS geom) AS t;
+
+   pt_on_surf    |                  centroid
+-----------------+---------------------------------------------
+ POINT(62.5 110) | POINT(100.18264840182648 85.11415525114155)
+</programlisting>
       </refsection>
 
       <refsection>

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

Summary of changes:
 doc/html/image_src/Makefile.in                     |  5 ++
 doc/html/image_src/st_pointonsurface.wkt           |  3 +
 .../{st_centroid01.wkt => st_pointonsurface01.wkt} |  2 +-
 .../{st_centroid02.wkt => st_pointonsurface02.wkt} |  2 +-
 ...aightskeleton01.wkt => st_pointonsurface03.wkt} |  1 +
 .../{st_centroid04.wkt => st_pointonsurface04.wkt} |  2 +-
 doc/reference_processing.xml                       | 85 ++++++++++++++++++++--
 7 files changed, 92 insertions(+), 8 deletions(-)
 create mode 100644 doc/html/image_src/st_pointonsurface.wkt
 copy doc/html/image_src/{st_centroid01.wkt => st_pointonsurface01.wkt} (69%)
 copy doc/html/image_src/{st_centroid02.wkt => st_pointonsurface02.wkt} (72%)
 copy doc/html/image_src/{st_straightskeleton01.wkt => st_pointonsurface03.wkt} (82%)
 copy doc/html/image_src/{st_centroid04.wkt => st_pointonsurface04.wkt} (83%)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list