[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-583-g398bee721

git at osgeo.org git at osgeo.org
Wed Feb 1 22:46:41 PST 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  398bee7211f8441720094ebbe9541d9fd256b590 (commit)
      from  1dd319f21f1b79c6ae684f39e232dc8576276488 (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 398bee7211f8441720094ebbe9541d9fd256b590
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Feb 1 22:51:10 2023 -0800

    Improve doc for ST_ChaikinSmoothing

diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in
index 46be56a00..4ab488ce6 100644
--- a/doc/html/image_src/Makefile.in
+++ b/doc/html/image_src/Makefile.in
@@ -55,6 +55,9 @@ IMAGES= \
 	../images/st_centroid02.png \
 	../images/st_centroid03.png \
 	../images/st_centroid04.png \
+	../images/st_chaikinsmoothing01.png \
+	../images/st_chaikinsmoothing02.png \
+	../images/st_chaikinsmoothing03.png \
 	../images/st_contains01.png \
 	../images/st_contains02.png \
 	../images/st_contains03.png \
diff --git a/doc/html/image_src/st_chaikinsmoothing01.wkt b/doc/html/image_src/st_chaikinsmoothing01.wkt
new file mode 100644
index 000000000..ca6466e1c
--- /dev/null
+++ b/doc/html/image_src/st_chaikinsmoothing01.wkt
@@ -0,0 +1,2 @@
+ArgA-thin;POLYGON ((20 20, 60 90, 10 150, 100 190, 190 160, 130 120, 190 50, 140 70, 120 10, 90 60, 20 20))
+Result;POLYGON((30 37.5,50 72.5,47.5 105,22.5 135,32.5 160,77.5 180,122.5 182.5,167.5 167.5,175 150,145 130,145 102.5,175 67.5,177.5 55,152.5 65,135 55,125 25,112.5 22.5,97.5 47.5,72.5 50,37.5 30,30 37.5))
diff --git a/doc/html/image_src/st_chaikinsmoothing02.wkt b/doc/html/image_src/st_chaikinsmoothing02.wkt
new file mode 100644
index 000000000..5301e57c4
--- /dev/null
+++ b/doc/html/image_src/st_chaikinsmoothing02.wkt
@@ -0,0 +1,2 @@
+ArgA-thin;POLYGON ((20 20, 60 90, 10 150, 100 190, 190 160, 130 120, 190 50, 140 70, 120 10, 90 60, 20 20))
+Result;POLYGON((35 46.25,45 63.75,49.375 80.625,48.125 96.875,41.25 112.5,28.75 127.5,25 141.25,30 153.75,43.75 165,66.25 175,88.75 180.625,111.25 181.875,133.75 178.75,156.25 171.25,169.375 163.125,173.125 154.375,167.5 145,152.5 135,145 123.125,145 109.375,152.5 93.75,167.5 76.25,175.625 64.375,176.875 58.125,171.25 57.5,158.75 62.5,148.125 62.5,139.375 57.5,132.5 47.5,127.5 32.5,121.875 24.375,115.625 23.125,108.75 28.75,101.25 41.25,91.25 48.125,78.75 49.375,63.75 45,46.25 35,35.625 31.875,31.875 35.625,35 46.25))
diff --git a/doc/html/image_src/st_chaikinsmoothing03.wkt b/doc/html/image_src/st_chaikinsmoothing03.wkt
new file mode 100644
index 000000000..f04521de6
--- /dev/null
+++ b/doc/html/image_src/st_chaikinsmoothing03.wkt
@@ -0,0 +1,2 @@
+ArgA-thin;POLYGON ((20 20, 60 90, 10 150, 100 190, 190 160, 130 120, 190 50, 140 70, 120 10, 90 60, 20 20))
+Result;POLYGON ((37.5 50.625, 42.5 59.375, 46.09375 67.96875, 48.28125 76.40625, 49.0625 84.6875, 48.4375 92.8125, 46.40625 100.78125, 42.96875 108.59375, 38.125 116.25, 31.875 123.75, 27.8125 130.9375, 25.9375 137.8125, 26.25 144.375, 28.75 150.625, 33.4375 156.5625, 40.3125 162.1875, 49.375 167.5, 60.625 172.5, 71.875 176.40625, 83.125 179.21875, 94.375 180.9375, 105.625 181.5625, 116.875 181.09375, 128.125 179.53125, 139.375 176.875, 150.625 173.125, 159.53125 169.21875, 166.09375 165.15625, 170.3125 160.9375, 172.1875 156.5625, 171.71875 152.03125, 168.90625 147.34375, 163.75 142.5, 156.25 137.5, 150.625 132.03125, 146.875 126.09375, 145 119.6875, 145 112.8125, 146.875 105.46875, 150.625 97.65625, 156.25 89.375, 163.75 80.625, 169.53125 73.28125, 173.59375 67.34375, 175.9375 62.8125, 176.5625 59.6875, 175.46875 57.96875, 172.65625 57.65625, 168.125 58.75, 161.875 61.25, 156.09375 62.5, 150.78125 62.5, 145.9375 61.25, 141.5625 58.75, 137.65625 55, 134.21875 50, 131.25 43.75, 128.
 75 36.25, 126.09375 30.46875, 123.28125 26.40625, 120.3125 24.0625, 117.1875 23.4375, 113.90625 24.53125, 110.46875 27.34375, 106.875 31.875, 103.125 38.125, 98.75 42.96875, 93.75 46.40625, 88.125 48.4375, 81.875 49.0625, 75 48.28125, 67.5 46.09375, 59.375 42.5, 50.625 37.5, 43.59375 34.21875, 38.28125 32.65625, 34.6875 32.8125, 32.8125 34.6875, 32.65625 38.28125, 34.21875 43.59375, 37.5 50.625))
diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml
index 99eda3106..9cb1427e4 100644
--- a/doc/reference_processing.xml
+++ b/doc/reference_processing.xml
@@ -627,33 +627,78 @@ POINT(0.5 1)
 
       <refsection>
         <title>Description</title>
-        <para> Returns a "smoothed" version of the given geometry using the Chaikin algorithm.
-        See <ulink url="http://www.idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm.html">Chaikins-Algorithm</ulink> for an explanation of the process.
-        For each iteration the number of vertex points will double.
-        The function puts new vertex points at 1/4 of the line before and after each point and removes the original point.
-        To reduce the number of points use one of the simplification functions on the result.
-        The new points gets interpolated values for all included dimensions, also z and m.</para>
-        <para>Second argument, number of iterations is limited to max 5 iterations</para>
-        <para>Note third argument is only valid for polygons, and will be ignored for linestrings</para>
-        <para>This function handles 3D and the third dimension will affect the result.</para>
-        <note><para>Note that returned geometry will get more points than the original.
-                To reduce the number of points again use one of the simplification functions on the result.
-                (see <xref linkend="ST_Simplify" /> and <xref linkend="ST_SimplifyVW" />)</para></note>
+        <para>Smoothes a geometry using
+        <ulink url="http://www.idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm.html">Chaikin's algorithm</ulink>.
+        The degree of smoothing is controlled by the <varname>nIterations</varname> parameter
+        (which is limited to a maximum of 5 iterations).
+        On each iteration, each vertex is replaced by two vertices placed at 1/4 of the length of the line segments before and after the vertex.
+        </para>
+
+        <note><para>The number of vertices doubles with each iteration,
+                so the result geometry may have many more points than the input.
+                To reduce the number of points use a simplification function on the result
+                (see <xref linkend="ST_Simplify" /> and <xref linkend="ST_SimplifyVW" />).</para></note>
+
+        <para>The <varname>preserveEndPoints</varname> parameter is valid only for polygons; it is ignored for linestrings.</para>
+
+        <para>The result has interpolated values for the Z and M dimenions when present.</para>
+
+        <para>&Z_support;</para>
         <para>Availability: 2.5.0</para>
       </refsection>
 
           <refsection>
             <title>Examples</title>
-            <para>A triangle is smoothed</para>
+            <para>Smoothing a triangle:</para>
                 <programlisting>
-select ST_AsText(ST_ChaikinSmoothing(geom)) smoothed
-FROM (SELECT  'POLYGON((0 0, 8 8, 0 16, 0 0))'::geometry geom) As foo;
-┌───────────────────────────────────────────┐
-│                 smoothed                  │
-├───────────────────────────────────────────┤
-│ POLYGON((2 2,6 6,6 10,2 14,0 12,0 4,2 2)) │
-└───────────────────────────────────────────┘
-                </programlisting>
+SELECT ST_AsText(ST_ChaikinSmoothing(geom)) smoothed
+FROM (SELECT  'POLYGON((0 0, 8 8, 0 16, 0 0))'::geometry geom) AS foo;
+
+                 smoothed
+───────────────────────────────────────────
+ POLYGON((2 2,6 6,6 10,2 14,0 12,0 4,2 2))
+</programlisting>
+
+    <informaltable>
+      <tgroup cols="3">
+      <tbody>
+        <row>
+        <entry><para><informalfigure>
+          <mediaobject>
+            <imageobject>
+            <imagedata fileref="images/st_chaikinsmoothing01.png" />
+            </imageobject>
+            <caption><para>nIterations = 1</para></caption>
+          </mediaobject>
+          </informalfigure></para></entry>
+
+        <entry><para><informalfigure>
+          <mediaobject>
+            <imageobject>
+            <imagedata fileref="images/st_chaikinsmoothing02.png" />
+            </imageobject>
+            <caption><para>nIterations = 2</para></caption>
+          </mediaobject>
+          </informalfigure></para></entry>
+
+        <entry><para><informalfigure>
+          <mediaobject>
+            <imageobject>
+            <imagedata fileref="images/st_chaikinsmoothing03.png" />
+            </imageobject>
+            <caption><para>nIterations = 3</para></caption>
+          </mediaobject>
+          </informalfigure></para></entry>
+        </row>
+      </tbody>
+      </tgroup>
+    </informaltable>
+           <para>Smoothing a polygon using 1, 2 and 3 iterations:</para>
+                <programlisting>
+SELECT ST_ChaikinSmoothing(
+            'POLYGON ((20 20, 60 90, 10 150, 100 190, 190 160, 130 120, 190 50, 140 70, 120 10, 90 60, 20 20))',
+            generate_series(1, 3) );
+</programlisting>
           </refsection>
           <refsection>
             <title>See Also</title>

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

Summary of changes:
 doc/html/image_src/Makefile.in               |  3 +
 doc/html/image_src/st_chaikinsmoothing01.wkt |  2 +
 doc/html/image_src/st_chaikinsmoothing02.wkt |  2 +
 doc/html/image_src/st_chaikinsmoothing03.wkt |  2 +
 doc/reference_processing.xml                 | 87 +++++++++++++++++++++-------
 5 files changed, 75 insertions(+), 21 deletions(-)
 create mode 100644 doc/html/image_src/st_chaikinsmoothing01.wkt
 create mode 100644 doc/html/image_src/st_chaikinsmoothing02.wkt
 create mode 100644 doc/html/image_src/st_chaikinsmoothing03.wkt


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list