example of using new PostgreSQL 9.0+ ORDER BY aggregate feature for ST_MakeLine

git-svn-id: http://svn.osgeo.org/postgis/trunk@7681 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Regina Obe 2011-07-27 11:52:51 +00:00
parent 075355c481
commit ffe153c10a

View file

@ -1224,7 +1224,15 @@ BOX3D(-989502.1875 528439.5625 10,-987121.375 529933.1875 10)
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>
GROUP BY gps.gps_track;</programlisting>
<programlisting>
-- 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
SELECT gps.gps_track, ST_MakeLine(gps.the_geom ORDER BY gps_track,gps_time) As newgeom
FROM gps_points
GROUP BY gps.gps_track;</programlisting>
</refsection>
<refsection>
<title>Examples: Non-Spatial Aggregate version</title>