mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 09:02:37 +00:00
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:
parent
075355c481
commit
ffe153c10a
|
@ -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
|
SELECT gps.gps_track, ST_MakeLine(gps.the_geom) As newgeom
|
||||||
FROM (SELECT gps_track,gps_time, the_geom
|
FROM (SELECT gps_track,gps_time, the_geom
|
||||||
FROM gps_points ORDER BY gps_track, gps_time) As gps
|
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>
|
||||||
<refsection>
|
<refsection>
|
||||||
<title>Examples: Non-Spatial Aggregate version</title>
|
<title>Examples: Non-Spatial Aggregate version</title>
|
||||||
|
|
Loading…
Reference in a new issue