Guest User

Untitled

a guest
Jan 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. SELECT ST_AsText(ST_MakeLine(start_point,end_point)) as geom FROM
  2. (
  3. SELECT
  4. ST_Pointn(geom, generate_series(1, ST_NumPoints(geom)-1)) as start_point,
  5. ST_Pointn(geom, generate_series(2, ST_NumPoints(geom))) as end_point
  6. FROM (
  7. SELECT ST_Segmentize(ST_GeomFromText('LINESTRING(0 0,0 50)'),5) as geom
  8. ) as line
  9. ) as tmp;
  10.  
  11. SELECT ST_AsText(ST_MakeLine(start_point,end_point)) as geom FROM
  12. (
  13. SELECT
  14. ST_Pointn(geom, generate_series(1, ST_NumPoints(geom)-1)) as start_point,
  15. ST_Pointn(geom, generate_series(2, ST_NumPoints(geom))) as end_point
  16. FROM (
  17. SELECT ST_Segmentize(ST_GeomFromText(
  18. 'LINESTRING(8.53011977325458 47.4525557235204,8.53683231588295 47.4527692267847)'
  19. ),5) as geom
  20. ) as line
  21. ) as tmp;
Add Comment
Please, Sign In to add comment