Created
February 24, 2019 09:16
-
-
Save kovid-rathee/7258d9594983f1c0454b5804d4a29164 to your computer and use it in GitHub Desktop.
Example from https://postgis.net/docs/ST_DumpPoints.html to Explode Linestring into Points
This file contains hidden or 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 edge_id, | |
(dp).path[1] As index, | |
ST_AsText((dp).geom) As wktnode | |
from (select 1 As edge_id, | |
ST_DumpPoints(ST_GeomFromText('LINESTRING(1 2, 3 4, 10 10)')) as dp | |
union all | |
select 2 As edge_id, | |
ST_DumpPoints(ST_GeomFromText('LINESTRING(3 5, 5 6, 9 10)')) as dp | |
) as foo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment