Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Join points with PostGIS
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