Created
July 29, 2016 12:14
-
-
Save ramiroaznar/71634140f2471e9a1804fe70798624e0 to your computer and use it in GitHub Desktop.
Routing Query & Styles with CARTO's Location Data Services API
This file contains 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 | |
1 as cartodb_id, length, shape as the_geom, 'Madrid' as origin | |
FROM | |
cdb_route_point_to_point( | |
cdb_geocode_namedplace_point('Madrid', 'Spain'), | |
cdb_geocode_namedplace_point('Rome', 'Italy'), | |
'car') | |
UNION ALL | |
SELECT | |
2 as cartodb_id, length, shape as the_geom, 'Paris' as origin | |
FROM | |
cdb_route_point_to_point( | |
cdb_geocode_namedplace_point('Paris', 'France'), | |
cdb_geocode_namedplace_point('Rome', 'Italy'), | |
'car') | |
UNION ALL | |
SELECT | |
3 as cartodb_id, length, shape as the_geom, 'Berlin' as origin | |
FROM | |
cdb_route_point_to_point( | |
cdb_geocode_namedplace_point('Berlin', 'Germany'), | |
cdb_geocode_namedplace_point('Rome', 'Italy'), | |
'car') | |
UNION ALL | |
SELECT | |
4 as cartodb_id, length, shape as the_geom, 'Athens' as origin | |
FROM | |
cdb_route_point_to_point( | |
cdb_geocode_namedplace_point('Athens', 'Greece'), | |
cdb_geocode_namedplace_point('Rome', 'Italy'), | |
'car') |
This file contains 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
#route {line-color: red; line-width: 2;line-opacity: 0.7;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment