]> granicus.if.org Git - postgis/commitdiff
Move ST_MakeLine from reference.xml to reference_new.xml and add an additional examp...
authorRegina Obe <lr@pcorp.us>
Tue, 15 Jul 2008 11:03:43 +0000 (11:03 +0000)
committerRegina Obe <lr@pcorp.us>
Tue, 15 Jul 2008 11:03:43 +0000 (11:03 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2851 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference.xml
doc/reference_new.xml

index e30029b8d34a1b20ac8671ea491bab2d8459cef5..c0f07d04bc7239ccf2e85e841fcddcdd1e00d75a 100644 (file)
@@ -1776,37 +1776,7 @@ GROUP BY gid, field1,field2;
             geometries.</para>
           </listitem>
         </varlistentry>
-
-        <varlistentry>
-          <term>ST_MakeLine(geometry set)</term>
-
-          <listitem>
-            <para>Creates a Linestring from a set of point geometries. You
-            might want to use a subselect to order points before feeding them
-            to this aggregate.</para>
-
-            <programlisting>
-SELECT gps.gps_track, ST_MakeLine(gps.the_geom) As newgeom
-       FROM (SELECT gps_track,gps_time, the_geom
-                       FROM gps_points ORDER BY gps_track, gps_time) As gps
-       GROUP BY gps.gps_track
-                         </programlisting>
-          </listitem>
-        </varlistentry>
-
-        <varlistentry>
-          <term>ST_MakeLine(geometry, geometry)</term>
-
-          <listitem>
-            <para>Creates a Linestring from the two given point
-            geometries.</para>
-
-            <programlisting>
-SELECT ST_AsText(ST_MakeLine(ST_MakePoint(1,2), ST_MakePoint(3,4)))
-                         </programlisting>
-          </listitem>
-        </varlistentry>
-
+               
         <varlistentry>
           <term>ST_LineFromMultiPoint(multipoint)</term>
 
index 56892dbaa42386adeb6708a7a446ffb904ec5a35..ece3b8690db51a973846077b13a32f17e343278d 100644 (file)
@@ -350,6 +350,71 @@ Check constraints:
   
   <sect1>
       <title>Geometry Constructors</title>
+       <refentry id="ST_MakeLine">
+               <refnamediv>
+               <refname>ST_MakeLine</refname>
+               
+               <refpurpose>Creates a Linestring from point geometries.</refpurpose>
+               </refnamediv>
+               
+               <refsynopsisdiv>
+               <funcsynopsis>
+                 <funcprototype>
+                       <funcdef>Geometry <function>ST_MakeLine</function></funcdef>
+                       <paramdef><type>Geometry set</type> <parameter>pointfield</parameter></paramdef>
+                 </funcprototype>
+               </funcsynopsis>
+               <funcsynopsis>
+                 <funcprototype>
+                       <funcdef>Geometry <function>ST_MakeLine</function></funcdef>
+                       <paramdef><type>Geometry</type> <parameter>point1</parameter></paramdef>
+                       <paramdef><type>Geometry</type> <parameter>point2</parameter></paramdef>
+                 </funcprototype>
+               </funcsynopsis>
+               </refsynopsisdiv>
+               
+               <refsection>
+               <title>Description</title>
+               
+               <para>ST_MakeLine comes in 2 forms: a spatial aggregate that takes
+                       rows of point geometries and returns a line string, and a regular function that takes two point geometries. You
+            might want to use a subselect to order points before feeding them
+            to  the aggregate version of this function.</para>
+               
+               <!-- optionally mention that this function uses indexes if appropriate -->
+               <note>
+                 <para>This function call will automatically include a bounding box
+                 comparison that will make use of any indexes that are available on the
+                 geometries.</para>
+               </note>
+               
+               </refsection>
+               
+               <refsection>
+               <title>Examples: Spatial Aggregate version</title>
+               <para>This example takes a sequence of GPS points and creates one record for each
+                       gps travel where the geometry field is a line string composed of the gps points
+                       in the order of the travel.</para>
+               
+               <programlisting>
+SELECT gps.gps_track, ST_MakeLine(gps.the_geom) As newgeom
+       FROM (SELECT gps_track,gps_time, the_geom
+                       FROM gps_points ORDER BY gps_track, gps_time) As gps
+       GROUP BY gps.gps_track</programlisting>
+               </refsection>
+               <refsection>
+               <title>Examples: Non-Spatial Aggregate version</title>
+               
+               <para>First example is a simple one off line string composed of 2 points.  The second formulates
+                       line strings from 2 points a user draws</para>
+               <programlisting>
+SELECT ST_AsText(ST_MakeLine(ST_MakePoint(1,2), ST_MakePoint(3,4)));
+SELECT up.id, ST_MakeLine(startpoint, endpoint) As drawn_line
+FROM userpoints;
+               </programlisting>
+               </refsection>
+               
+               </refentry>  
   </sect1>
    
   <sect1>