Skip to main content
datatype correction
Source Link
Vince
  • 20.5k
  • 16
  • 49
  • 65

This is what ST_DumpPoints is for:

SELECT ST_X((dp).geom) AS lon, ST_Y((dp).geom) AS lat FROM ( SELECT ST_DumpPoints( ST_GeomFromTextST_GeogFromText('MULTILINESTRING((-121.382859 41.9831,-121.382849 41.983485))')::geometry ) AS dp ) AS foo; 

Output:

"lon";"lat" -121.382859;41.9831 -121.382849;41.983485 

This is what ST_DumpPoints is for:

SELECT ST_X((dp).geom) AS lon, ST_Y((dp).geom) AS lat FROM ( SELECT ST_DumpPoints( ST_GeomFromText('MULTILINESTRING((-121.382859 41.9831,-121.382849 41.983485))') ) AS dp ) AS foo; 

Output:

"lon";"lat" -121.382859;41.9831 -121.382849;41.983485 

This is what ST_DumpPoints is for:

SELECT ST_X((dp).geom) AS lon, ST_Y((dp).geom) AS lat FROM ( SELECT ST_DumpPoints( ST_GeogFromText('MULTILINESTRING((-121.382859 41.9831,-121.382849 41.983485))')::geometry ) AS dp ) AS foo; 

Output:

"lon";"lat" -121.382859;41.9831 -121.382849;41.983485 
Source Link
alphabetasoup
  • 9.1k
  • 4
  • 43
  • 82

This is what ST_DumpPoints is for:

SELECT ST_X((dp).geom) AS lon, ST_Y((dp).geom) AS lat FROM ( SELECT ST_DumpPoints( ST_GeomFromText('MULTILINESTRING((-121.382859 41.9831,-121.382849 41.983485))') ) AS dp ) AS foo; 

Output:

"lon";"lat" -121.382859;41.9831 -121.382849;41.983485