Guest User

Untitled

a guest
Mar 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. WITH lines as (
  2. SELECT
  3. a.cartodb_id,
  4. a.origen_oaci || '-' || b.destino_oaci as route,
  5. ST_Segmentize(
  6. ST_Makeline(
  7. cdb_latlng(1,1),
  8. cdb_latlng(50,50)
  9. )::geography,
  10. 100
  11. )::geometry as the_geom
  12. FROM
  13. modernizacion.datos_2016_resumidos a,
  14. modernizacion.datos_2016_resumidos b
  15. WHERE
  16. a.cartodb_id = b.cartodb_id)
  17. SELECT
  18. *,
  19. case when ST_XMax(the_geom) - ST_XMin(the_geom) <= 180
  20. then ST_Transform(the_geom,3857)
  21. when ST_XMax(the_geom) - ST_XMin(the_geom) > 180
  22. then ST_Transform(ST_Difference(ST_Shift_Longitude(the_geom),
  23. ST_Buffer(ST_GeomFromText('LINESTRING(180 90, 180 -90)',4326),
  24. 0.00001)),3857)
  25. end as the_geom_webmercator
  26. FROM
  27. lines
  28.  
  29. SELECT (ST_DumpPoints(
  30. ST_Segmentize(the_geom, 1))).geom as new_the_geom FROM
Add Comment
Please, Sign In to add comment