Created
April 30, 2017 19:14
-
-
Save alrocar/cd791b51fc2e5239792a871649326fba to your computer and use it in GitHub Desktop.
Join points with PostGIS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cartodb_id, ele, time, ST_MAKELINE(the_geom,the_geom2) as the_geom FROM ( | |
SELECT cartodb_id, row_number() OVER w AS ele, time, the_geom, lead(the_geom) OVER w AS the_geom2 | |
FROM TRACK_POINTS WINDOW w AS (PARTITION BY track_fid ORDER BY cartodb_id) ) as q | |
WHERE the_geom2 IS NOT NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment