From 5c1b94ef1ce1e0780275ccac40c092eea60938e0 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Tue, 15 Jul 2008 11:03:43 +0000 Subject: [PATCH] Move ST_MakeLine from reference.xml to reference_new.xml and add an additional example to ST_MakeLine git-svn-id: http://svn.osgeo.org/postgis/trunk@2851 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference.xml | 32 +-------------------- doc/reference_new.xml | 65 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 31 deletions(-) diff --git a/doc/reference.xml b/doc/reference.xml index e30029b8d..c0f07d04b 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -1776,37 +1776,7 @@ GROUP BY gid, field1,field2; geometries. - - - ST_MakeLine(geometry set) - - - 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. - - -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 - - - - - - ST_MakeLine(geometry, geometry) - - - Creates a Linestring from the two given point - geometries. - - -SELECT ST_AsText(ST_MakeLine(ST_MakePoint(1,2), ST_MakePoint(3,4))) - - - - + ST_LineFromMultiPoint(multipoint) diff --git a/doc/reference_new.xml b/doc/reference_new.xml index 56892dbaa..ece3b8690 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -350,6 +350,71 @@ Check constraints: Geometry Constructors + + + ST_MakeLine + + Creates a Linestring from point geometries. + + + + + + Geometry ST_MakeLine + Geometry set pointfield + + + + + Geometry ST_MakeLine + Geometry point1 + Geometry point2 + + + + + + Description + + 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. + + + + This function call will automatically include a bounding box + comparison that will make use of any indexes that are available on the + geometries. + + + + + + Examples: Spatial Aggregate version + 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. + + +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 + + + Examples: Non-Spatial Aggregate version + + First example is a simple one off line string composed of 2 points. The second formulates + line strings from 2 points a user draws + +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; + + + + -- 2.50.1