[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-460-g8549294e8
git at osgeo.org
git at osgeo.org
Wed Feb 2 11:14:13 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 8549294e8c8b289e24a141f99e1859f640937a7d (commit)
from 6f335e8117bcbc43daa9e0536c0703e3926f8acd (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 8549294e8c8b289e24a141f99e1859f640937a7d
Author: Martin Davis <mtnclimb at gmail.com>
Date: Wed Feb 2 11:14:08 2022 -0800
Improve doc ST_ClusterKmeans examples
diff --git a/doc/html/image_src/Makefile.in b/doc/html/image_src/Makefile.in
index 99d729eb4..fb4bf5cb2 100644
--- a/doc/html/image_src/Makefile.in
+++ b/doc/html/image_src/Makefile.in
@@ -47,7 +47,6 @@ IMAGES= \
../images/st_buildarea01.png \
../images/st_closestpoint01.png \
../images/st_closestpoint02.png \
- ../images/st_clusterkmeans01.png \
../images/st_clusterkmeans02.png \
../images/st_centroid01.png \
../images/st_centroid02.png \
diff --git a/doc/html/image_src/st_clusterkmeans01.wkt b/doc/html/image_src/st_clusterkmeans01.wkt
deleted file mode 100644
index c9e1e7abf..000000000
--- a/doc/html/image_src/st_clusterkmeans01.wkt
+++ /dev/null
@@ -1,7 +0,0 @@
-ArgA;POLYGON((0 60,0 112.262823104858,69.9840240478516 112.262823104858,69.9840240478516 35.2699669619124,32.8889744907202 60,0 60))
-ArgA;POLYGON((69.9840240478516 35.2699669619124,69.9840240478516 73.3964014053345,127.637811131417 73.3964014053345,125.713274243959 71.1560330280473,119.721714690708 66.4118010173891,112.937223991122 62.8936752097563,105.60746371632 60.7300815406388,98 60,88.0740170061865 60,71.0940039245046 34.5299803774771,69.9840240478516 35.2699669619124))
-ArgA;POLYGON((69.9840240478516 73.3964014053345,69.9840240478516 112.262823104858,138.522500134424 112.262823104858,137.968038348872 98.4012784660451,136.934484771969 90.829073354271,134.479663763751 83.5916444552268,130.693186299402 76.9531874309565,127.637811131417 73.3964014053345,69.9840240478516 73.3964014053345))
-ArgA;POLYGON((0 112.262823104858,0 140,45.2593163271468 140,66.7179882264863 172.188007849009,69.9840240478516 176.163370657516,69.9840240478516 112.262823104858,0 112.262823104858))
-ArgA;POLYGON((69.9840240478516 112.262823104858,69.9840240478516 151.129244804382,139.80478252734 151.129244804382,139.968038348872 148.401278466045,138.522500134424 112.262823104858,69.9840240478516 112.262823104858))
-ArgA;POLYGON((69.9840240478516 151.129244804382,69.9840240478516 176.163370657516,71.7754637625827 178.343880365658,77.9526212087179 183.375336529146,85.0044095429824 187.08277587837,92.6510806850222 189.319122382143,100.589287246674 189.99565902121,104.976036071777 189.491234771783,104.976036071777 151.129244804382,69.9840240478516 151.129244804382))
-ArgA;POLYGON((104.976036071777 151.129244804382,104.976036071777 189.491234771783,108.50411647931 189.085547238159,116.081583025004 186.624891636835,123.021084877624 182.711307694087,129.047328419456 177.500049303452,133.921249461013 171.19784977312,137.44949704073 164.054720608975,139.492103757341 156.354033429203,139.80478252734 151.129244804382,104.976036071777 151.129244804382))
diff --git a/doc/reference_cluster.xml b/doc/reference_cluster.xml
index ce2508a92..860a3f8ec 100644
--- a/doc/reference_cluster.xml
+++ b/doc/reference_cluster.xml
@@ -248,7 +248,7 @@ GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
<refsection>
<title>Examples</title>
- <para>Generate dummy set of parcels for examples</para>
+ <para>Generate dummy set of parcels for examples:</para>
<programlisting>CREATE TABLE parcels AS
SELECT lpad((row_number() over())::text,3,'0') As parcel_id, geom,
('{residential, commercial}'::text[])[1 + mod(row_number()OVER(),2)] As type
@@ -257,31 +257,17 @@ FROM
40, 'endcap=square'),12) As geom;
</programlisting>
- <informaltable>
- <tgroup cols="1">
- <tbody>
- <row>
- <entry>
- <para><informalfigure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/st_clusterkmeans01.png" />
- </imageobject>
- <caption><para>Original Parcels</para></caption>
- </mediaobject>
- </informalfigure>
- </para>
- </entry>
- <entry><para><informalfigure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/st_clusterkmeans02.png" />
- </imageobject>
- <caption><para>Parcels color-coded by cluster number (cid)</para></caption>
- </mediaobject>
- </informalfigure>
- <programlisting>SELECT ST_ClusterKMeans(geom, 5) OVER() AS cid, parcel_id, geom
-FROM parcels;</programlisting>
+ <para><informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_clusterkmeans02.png" />
+ </imageobject>
+ <caption><para>Parcels color-coded by cluster number (cid)</para></caption>
+ </mediaobject>
+ </informalfigure>
+<programlisting>
+SELECT ST_ClusterKMeans(geom, 3) OVER() AS cid, parcel_id, geom
+ FROM parcels;</programlisting>
<screen> cid | parcel_id | geom
-----+-----------+---------------
0 | 001 | 0103000000...
@@ -291,15 +277,13 @@ FROM parcels;</programlisting>
1 | 005 | 0103000000...
2 | 006 | 0103000000...
2 | 007 | 0103000000...
-(7 rows)</screen>
- </para></entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-<para>Partitioning parcel clusters by type:</para>
- <programlisting>SELECT ST_ClusterKMeans(geom, 3) over (PARTITION BY type) AS cid, parcel_id, type
-FROM parcels;</programlisting>
+</screen>
+ </para>
+
+ <para>Partitioning parcel clusters by type:</para>
+<programlisting>
+SELECT ST_ClusterKMeans(geom, 3) over (PARTITION BY type) AS cid, parcel_id, type
+ FROM parcels;</programlisting>
<screen> cid | parcel_id | type
-----+-----------+-------------
1 | 005 | commercial
@@ -309,12 +293,14 @@ FROM parcels;</programlisting>
1 | 004 | residential
0 | 002 | residential
2 | 006 | residential
-(7 rows)</screen>
-
-
-<para>Clustering preaggregated planetary scale data like population dataset may require using 3D clusering and weighting.
-Let's try to idenify 20-ish meta-regions based on <ulink url="https://data.humdata.org/dataset/kontur-population-dataset">Kontur Population</ulink> that will not span more than 3000 km from their center:</para>
- <programlisting>create table kontur_population_3000km_clusters as
+</screen>
+
+<para>Example: Clustering a preaggregated planetary-scale data population dataset
+using 3D clusering and weighting.
+Identify at least 20 regions based on
+<ulink url="https://data.humdata.org/dataset/kontur-population-dataset">Kontur Population Data</ulink>
+that do not span more than 3000 km from their center:</para>
+<programlisting>create table kontur_population_3000km_clusters as
select
geom,
ST_ClusterKMeans(
@@ -333,7 +319,11 @@ from
<imageobject>
<imagedata fileref="images/st_clusterkmeans03.png" />
</imageobject>
- <caption><para>World population clustered to above specs: 46 resulting clusters. Greenland is one cluster, there are island clusters that span across antimeridian, clusters are centered at well-populated regions (New York, Moscow), and edges follow Earth's curvature.</para></caption>
+ <caption><para>World population clustered to above specs produces 46 clusters.
+ Clusters are centered at well-populated regions (New York, Moscow).
+ Greenland is one cluster.
+ There are island clusters that span across the antimeridian.
+ Cluster edges follow Earth's curvature.</para></caption>
</mediaobject>
</informalfigure>
</para>
-----------------------------------------------------------------------
Summary of changes:
doc/html/image_src/Makefile.in | 1 -
doc/html/image_src/st_clusterkmeans01.wkt | 7 ---
doc/reference_cluster.xml | 74 +++++++++++++------------------
3 files changed, 32 insertions(+), 50 deletions(-)
delete mode 100644 doc/html/image_src/st_clusterkmeans01.wkt
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list