From: Regina Obe Date: Wed, 27 Jul 2011 19:21:09 +0000 (+0000) Subject: minor updates to ST_MakeLine to clarify pre-9.0 and 9.0+ approaches X-Git-Tag: 2.0.0alpha1~1162 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0a949ad8eab3f156e382fca3135ca6ca0f6f3e8;p=postgis minor updates to ST_MakeLine to clarify pre-9.0 and 9.0+ approaches git-svn-id: http://svn.osgeo.org/postgis/trunk@7684 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_constructor.xml b/doc/reference_constructor.xml index 433db0c86..7fcb25474 100644 --- a/doc/reference_constructor.xml +++ b/doc/reference_constructor.xml @@ -1221,6 +1221,8 @@ BOX3D(-989502.1875 528439.5625 10,-987121.375 529933.1875 10) in the order of the travel. +-- For pre-PostgreSQL 9.0 - this usually works, +-- but the planner may on occasion choose not to respect the order of the subquery 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 @@ -1229,7 +1231,8 @@ SELECT gps.gps_track, ST_MakeLine(gps.the_geom) As newgeom -- If you are using PostgreSQL 9.0+ -- (you can use the new ORDER BY support for aggregates) --- this is a more guaranteed way to get ordered linestring +-- this is a guaranteed way to get a correctly ordered linestring +-- Your order by part can order by more than one column if needed SELECT gps.gps_track, ST_MakeLine(gps.the_geom ORDER BY gps_time) As newgeom FROM gps_points As gps GROUP BY gps.gps_track;