Skip to content

Instantly share code, notes, and snippets.

@mojodna
Created August 11, 2013 16:11
Show Gist options
  • Save mojodna/6205513 to your computer and use it in GitHub Desktop.
Save mojodna/6205513 to your computer and use it in GitHub Desktop.
Break a LINESTRING or MULTILINESTRING into its constituent points with PostGIS.
SELECT ST_AsText(
ST_PointN(
way,
generate_series(1, ST_NPoints(way))
)
)
FROM (
SELECT (ST_Dump(way)).geom AS way
FROM planet_osm_line WHERE osm_id=25813470) AS dumped;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment