Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH lines as (
- SELECT
- a.cartodb_id,
- a.origen_oaci || '-' || b.destino_oaci as route,
- ST_Segmentize(
- ST_Makeline(
- cdb_latlng(1,1),
- cdb_latlng(50,50)
- )::geography,
- 100
- )::geometry as the_geom
- FROM
- modernizacion.datos_2016_resumidos a,
- modernizacion.datos_2016_resumidos b
- WHERE
- a.cartodb_id = b.cartodb_id)
- SELECT
- *,
- case when ST_XMax(the_geom) - ST_XMin(the_geom) <= 180
- then ST_Transform(the_geom,3857)
- when ST_XMax(the_geom) - ST_XMin(the_geom) > 180
- then ST_Transform(ST_Difference(ST_Shift_Longitude(the_geom),
- ST_Buffer(ST_GeomFromText('LINESTRING(180 90, 180 -90)',4326),
- 0.00001)),3857)
- end as the_geom_webmercator
- FROM
- lines
- SELECT (ST_DumpPoints(
- ST_Segmentize(the_geom, 1))).geom as new_the_geom FROM
Add Comment
Please, Sign In to add comment