]> granicus.if.org Git - postgis/commitdiff
Move all ST_Cluster* docs to measurement section
authorDaniel Baston <dbaston@gmail.com>
Wed, 24 Feb 2016 13:00:16 +0000 (13:00 +0000)
committerDaniel Baston <dbaston@gmail.com>
Wed, 24 Feb 2016 13:00:16 +0000 (13:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14677 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_measure.xml
doc/reference_processing.xml

index fabeb9b4631f2ba27de9968011f5e260892f6c6e..1cf1b7c8cdc4cc0fda1f0a4f606f6dfec59d6ddb 100644 (file)
@@ -1032,6 +1032,236 @@ SELECT ST_AsText(
          </refsection>
 </refentry>
 
+    <refentry id="ST_ClusterDBSCAN">
+         <refnamediv>
+               <refname>ST_ClusterDBSCAN</refname>
+
+        <refpurpose>Windowing function that returns integer id for the cluster each input geometry is in.</refpurpose>
+    </refnamediv>
+
+         <refsynopsisdiv>
+               <funcsynopsis>
+                 <funcprototype>
+                       <funcdef>integer <function>ST_ClusterDBSCAN</function></funcdef>
+
+                       <paramdef><type>geometry </type>
+                       <parameter>geom</parameter></paramdef>
+
+                       <paramdef><type>float8 </type>
+                       <parameter>eps</parameter></paramdef>
+
+                       <paramdef><type>int </type>
+                       <parameter>minpoints</parameter></paramdef>
+                 </funcprototype>
+               </funcsynopsis>
+         </refsynopsisdiv>
+
+         <refsection>
+      <title>Description</title>
+
+      <para>Returns cluster number for each input geometry, based on a 2D 
+          implementation of the 
+          <ulink url="https://en.wikipedia.org/wiki/DBSCAN">DBSCAN</ulink> 
+          algorithm.  An input geometry will be added to a cluster if it is 
+          within <varname>eps</varname> distance of at least
+          <varname>minpoints</varname> other input geometries.
+      </para>
+    </refsection>
+
+    <refsection>
+      <title>Examples</title>
+      <para>
+          Assigning a cluster number to each parcel point:
+      </para>
+                   <programlisting>
+SELECT parcel_id, ST_ClusterDBSCAN(geom, eps := 0.5, minpoints := 5) over () AS cid
+FROM parcels;
+</programlisting>
+
+
+        <para>
+            Combining parcels with the same cluster number into a single geometry:
+        </para>
+                   <programlisting>
+SELECT cid, ST_Collect(geom) AS cluster_geom, array_agg(parcel_id) AS ids_in_cluster FROM (
+    SELECT parcel_id, ST_ClusterDBSCAN(geom, eps := 0.5, minpoints := 5) over () AS cid, geom
+    FROM parcels) sq
+GROUP BY cid;
+    </programlisting>
+    </refsection>
+
+    <refsection>
+                 <title>See Also</title>
+          <para>
+              <xref linkend="ST_ClusterKMeans"/>,
+              <xref linkend="ST_ClusterIntersecting"/>,
+              <xref linkend="ST_ClusterWithin"/> 
+          </para>
+         </refsection>
+
+    </refentry>
+
+    <refentry id="ST_ClusterIntersecting">
+      <refnamediv>
+        <refname>ST_ClusterIntersecting</refname>
+
+        <refpurpose>Aggregate.  Returns an array with the connected components of a set of geometries</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>geometry[] <function>ST_ClusterIntersecting</function></funcdef>
+            <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
+      </refsynopsisdiv>
+
+      <refsection>
+        <title>Description</title>
+
+        <para>ST_ClusterIntersecting is an aggregate function that returns an array of GeometryCollections, where each GeometryCollection represents an interconnected set of geometries.</para>
+
+        <para>Availability: 2.2.0 - requires GEOS </para>
+      </refsection>
+
+      <refsection>
+        <title>Examples</title>
+        <programlisting>
+WITH testdata AS
+  (SELECT unnest(ARRAY['LINESTRING (0 0, 1 1)'::geometry,
+                      'LINESTRING (5 5, 4 4)'::geometry,
+                      'LINESTRING (6 6, 7 7)'::geometry,
+                      'LINESTRING (0 0, -1 -1)'::geometry,
+                      'POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))'::geometry]) AS geom)
+
+SELECT ST_AsText(unnest(ST_ClusterIntersecting(geom))) FROM testdata;
+
+--result
+
+st_astext
+---------
+GEOMETRYCOLLECTION(LINESTRING(0 0,1 1),LINESTRING(5 5,4 4),LINESTRING(0 0,-1 -1),POLYGON((0 0,4 0,4 4,0 4,0 0)))
+GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
+        </programlisting>
+      </refsection>
+      <refsection>
+        <title>See Also</title>
+        <para>
+            <xref linkend="ST_ClusterDBSCAN" />,
+            <xref linkend="ST_ClusterKMeans" />,
+            <xref linkend="ST_ClusterWithin" />
+        </para>
+      </refsection>
+
+    </refentry>
+
+
+       <refentry id="ST_ClusterKMeans">
+         <refnamediv>
+               <refname>ST_ClusterKMeans</refname>
+
+               <refpurpose>Windowing function that returns integer id for the cluster each input geometry is in.</refpurpose>
+         </refnamediv>
+
+         <refsynopsisdiv>
+               <funcsynopsis>
+                 <funcprototype>
+                       <funcdef>integer <function>ST_ClusterKMeans</function></funcdef>
+
+                       <paramdef><type>geometry </type>
+                       <parameter>geom</parameter></paramdef>
+
+                       <paramdef><type>integer </type>
+                       <parameter>number_of_clusters</parameter></paramdef>
+                 </funcprototype>
+               </funcsynopsis>
+         </refsynopsisdiv>
+
+         <refsection>
+      <title>Description</title>
+
+      <para>Returns 2D distance based 
+        <ulink url="https://en.wikipedia.org/wiki/K-means_clustering">k-means</ulink> 
+        cluster number for each input geometry. The distance used for clustering is the 
+        distance between the centroids of the geometries.
+      </para>
+    </refsection>
+
+    <refsection>
+      <title>Examples</title>
+                   <programlisting>
+SELECT ST_ClusterKMeans(geom, 5) over (), geom, parcel_id 
+FROM parcels;
+</programlisting>
+    </refsection>
+
+    <refsection>
+                 <title>See Also</title>
+          <para>
+              <xref linkend="ST_ClusterDBSCAN"/>,
+              <xref linkend="ST_ClusterIntersecting" />,
+              <xref linkend="ST_ClusterWithin" /> 
+          </para>
+         </refsection>
+       </refentry>  
+
+       <refentry id="ST_ClusterWithin">
+      <refnamediv>
+        <refname>ST_ClusterWithin</refname>
+
+        <refpurpose>Aggregate.  Returns an array of GeometryCollections, where each GeometryCollection represents a set of geometries separated by no more than the specified distance.</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>geometry[] <function>ST_ClusterWithin</function></funcdef>
+            <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
+            <paramdef><type>float8 </type> <parameter>distance</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
+      </refsynopsisdiv>
+
+      <refsection>
+        <title>Description</title>
+
+        <para>ST_ClusterWithin is an aggregate function that returns an array of GeometryCollections, where each GeometryCollection represents a set of geometries separated by no more than the specified distance.</para>
+
+        <para>Availability: 2.2.0 - requires GEOS</para>
+      </refsection>
+
+      <refsection>
+        <title>Examples</title>
+        <programlisting>
+WITH testdata AS
+  (SELECT unnest(ARRAY['LINESTRING (0 0, 1 1)'::geometry,
+                      'LINESTRING (5 5, 4 4)'::geometry,
+                      'LINESTRING (6 6, 7 7)'::geometry,
+                      'LINESTRING (0 0, -1 -1)'::geometry,
+                      'POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))'::geometry]) AS geom)
+
+SELECT ST_AsText(unnest(ST_ClusterWithin(geom, 1.4))) FROM testdata;
+
+--result
+
+st_astext
+---------
+GEOMETRYCOLLECTION(LINESTRING(0 0,1 1),LINESTRING(5 5,4 4),LINESTRING(0 0,-1 -1),POLYGON((0 0,4 0,4 4,0 4,0 0)))
+GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
+        </programlisting>
+      </refsection>
+      <refsection>
+        <title>See Also</title>
+        <para>
+          <xref linkend="ST_ClusterDBSCAN" />,
+          <xref linkend="ST_ClusterKMeans" />,
+          <xref linkend="ST_ClusterIntersecting" />
+        </para>
+      </refsection>
+
+    </refentry>
+
   <refentry id="ST_Contains">
          <refnamediv>
                <refname>ST_Contains</refname>
@@ -4160,117 +4390,6 @@ SELECT ST_Buffer(ST_GeomFromText('POINT(50 50)'), 20) As smallc,
                <para><xref linkend="ST_Contains"/>, <xref linkend="ST_Equals"/>, <xref linkend="ST_IsValid"/></para>
          </refsection>
        </refentry>
-
-    <refentry id="ST_ClusterDBSCAN">
-         <refnamediv>
-               <refname>ST_ClusterDBSCAN</refname>
-
-        <refpurpose>Windowing function that returns integer id for the cluster each input geometry is in.</refpurpose>
-    </refnamediv>
-
-         <refsynopsisdiv>
-               <funcsynopsis>
-                 <funcprototype>
-                       <funcdef>integer <function>ST_ClusterDBSCAN</function></funcdef>
-
-                       <paramdef><type>geometry </type>
-                       <parameter>geom</parameter></paramdef>
-
-                       <paramdef><type>float8 </type>
-                       <parameter>eps</parameter></paramdef>
-
-                       <paramdef><type>int </type>
-                       <parameter>minpoints</parameter></paramdef>
-                 </funcprototype>
-               </funcsynopsis>
-         </refsynopsisdiv>
-
-         <refsection>
-      <title>Description</title>
-
-      <para>Returns cluster number for each input geometry, based on a 2D 
-          implementation of the 
-          <ulink url="https://en.wikipedia.org/wiki/DBSCAN">DBSCAN</ulink> 
-          algorithm.  An input geometry will be added to a cluster if it is 
-          within <varname>eps</varname> distance of at least
-          <varname>minpoints</varname> other input geometries.
-      </para>
-    </refsection>
-
-    <refsection>
-      <title>Examples</title>
-      <para>
-          Assigning a cluster number to each parcel point:
-      </para>
-                   <programlisting>
-SELECT parcel_id, ST_ClusterDBSCAN(geom, eps := 0.5, minpoints := 5) over () AS cid
-FROM parcels;
-</programlisting>
-
-
-        <para>
-            Combining parcels with the same cluster number into a single geometry:
-        </para>
-                   <programlisting>
-SELECT cid, ST_Collect(geom) AS cluster_geom, array_agg(parcel_id) AS ids_in_cluster FROM (
-    SELECT parcel_id, ST_ClusterDBSCAN(geom, eps := 0.5, minpoints := 5) over () AS cid, geom
-    FROM parcels) sq
-GROUP BY cid;
-</programlisting>
-    </refsection>
-
-    <refsection>
-                 <title>See Also</title>
-      <para><xref linkend="ST_ClusterKMeans"/></para>
-         </refsection>
-
-    </refentry>
-
-  
-       <refentry id="ST_ClusterKMeans">
-         <refnamediv>
-               <refname>ST_ClusterKMeans</refname>
-
-               <refpurpose>Windowing function that returns integer id for the cluster each input geometry is in.</refpurpose>
-         </refnamediv>
-
-         <refsynopsisdiv>
-               <funcsynopsis>
-                 <funcprototype>
-                       <funcdef>integer <function>ST_ClusterKMeans</function></funcdef>
-
-                       <paramdef><type>geometry </type>
-                       <parameter>geom</parameter></paramdef>
-
-                       <paramdef><type>integer </type>
-                       <parameter>number_of_clusters</parameter></paramdef>
-                 </funcprototype>
-               </funcsynopsis>
-         </refsynopsisdiv>
-
-         <refsection>
-      <title>Description</title>
-
-      <para>Returns 2D distance based 
-        <ulink url="https://en.wikipedia.org/wiki/K-means_clustering">k-means</ulink> 
-        cluster number for each input geometry. The distance used for clustering is the 
-        distance between the centroids of the geometries.
-      </para>
-    </refsection>
-
-    <refsection>
-      <title>Examples</title>
-                   <programlisting>
-SELECT ST_ClusterKMeans(geom, 5) over (), geom, parcel_id 
-FROM parcels;
-</programlisting>
-    </refsection>
-
-    <refsection>
-                 <title>See Also</title>
-      <para><xref linkend="ST_ClusterDBSCAN"/></para>
-         </refsection>
-       </refentry>  
   
   
 </sect1>
index 11dd8855af1e52bdfbaf0f6d83ef3e3578d3eabb..23c154fb2ecc23aea10731693e5521cc2f5323ee 100644 (file)
@@ -416,113 +416,6 @@ SELECT ST_ClipByBox2D(the_geom, ST_MakeEnvelope(0,0,10,10)) FROM mytab;
          </refsection>
        </refentry>
        
-           <refentry id="ST_ClusterIntersecting">
-      <refnamediv>
-        <refname>ST_ClusterIntersecting</refname>
-
-        <refpurpose>Aggregate.  Returns an array with the connected components of a set of geometries</refpurpose>
-      </refnamediv>
-
-      <refsynopsisdiv>
-        <funcsynopsis>
-          <funcprototype>
-            <funcdef>geometry[] <function>ST_ClusterIntersecting</function></funcdef>
-            <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
-          </funcprototype>
-        </funcsynopsis>
-      </refsynopsisdiv>
-
-      <refsection>
-        <title>Description</title>
-
-        <para>ST_ClusterIntersecting is an aggregate function that returns an array of GeometryCollections, where each GeometryCollection represents an interconnected set of geometries.</para>
-
-        <para>Availability: 2.2.0 - requires GEOS </para>
-      </refsection>
-
-      <refsection>
-        <title>Examples</title>
-        <programlisting>
-WITH testdata AS
-  (SELECT unnest(ARRAY['LINESTRING (0 0, 1 1)'::geometry,
-                      'LINESTRING (5 5, 4 4)'::geometry,
-                      'LINESTRING (6 6, 7 7)'::geometry,
-                      'LINESTRING (0 0, -1 -1)'::geometry,
-                      'POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))'::geometry]) AS geom)
-
-SELECT ST_AsText(unnest(ST_ClusterIntersecting(geom))) FROM testdata;
-
---result
-
-st_astext
----------
-GEOMETRYCOLLECTION(LINESTRING(0 0,1 1),LINESTRING(5 5,4 4),LINESTRING(0 0,-1 -1),POLYGON((0 0,4 0,4 4,0 4,0 0)))
-GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
-        </programlisting>
-      </refsection>
-      <refsection>
-        <title>See Also</title>
-        <para>
-          <xref linkend="ST_ClusterWithin" />,
-        </para>
-      </refsection>
-
-    </refentry>
-
-       <refentry id="ST_ClusterWithin">
-      <refnamediv>
-        <refname>ST_ClusterWithin</refname>
-
-        <refpurpose>Aggregate.  Returns an array of GeometryCollections, where each GeometryCollection represents a set of geometries separated by no more than the specified distance.</refpurpose>
-      </refnamediv>
-
-      <refsynopsisdiv>
-        <funcsynopsis>
-          <funcprototype>
-            <funcdef>geometry[] <function>ST_ClusterWithin</function></funcdef>
-            <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
-            <paramdef><type>float8 </type> <parameter>distance</parameter></paramdef>
-          </funcprototype>
-        </funcsynopsis>
-      </refsynopsisdiv>
-
-      <refsection>
-        <title>Description</title>
-
-        <para>ST_ClusterWithin is an aggregate function that returns an array of GeometryCollections, where each GeometryCollection represents a set of geometries separated by no more than the specified distance.</para>
-
-        <para>Availability: 2.2.0 - requires GEOS</para>
-      </refsection>
-
-      <refsection>
-        <title>Examples</title>
-        <programlisting>
-WITH testdata AS
-  (SELECT unnest(ARRAY['LINESTRING (0 0, 1 1)'::geometry,
-                      'LINESTRING (5 5, 4 4)'::geometry,
-                      'LINESTRING (6 6, 7 7)'::geometry,
-                      'LINESTRING (0 0, -1 -1)'::geometry,
-                      'POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))'::geometry]) AS geom)
-
-SELECT ST_AsText(unnest(ST_ClusterWithin(geom, 1.4))) FROM testdata;
-
---result
-
-st_astext
----------
-GEOMETRYCOLLECTION(LINESTRING(0 0,1 1),LINESTRING(5 5,4 4),LINESTRING(0 0,-1 -1),POLYGON((0 0,4 0,4 4,0 4,0 0)))
-GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))
-        </programlisting>
-      </refsection>
-      <refsection>
-        <title>See Also</title>
-        <para>
-          <xref linkend="ST_ClusterIntersecting" />,
-        </para>
-      </refsection>
-
-    </refentry>
-
        <refentry id="ST_Collect">
          <refnamediv>
                <refname>ST_Collect</refname>