TravelDirections[{loc1,loc2,…}]
generates directions for travel from loc1 to loc2, ….
TravelDirections[{loc1,loc2,…},"prop"]
gives the property prop of travel directions.
TravelDirections
TravelDirections[{loc1,loc2,…}]
generates directions for travel from loc1 to loc2, ….
TravelDirections[{loc1,loc2,…},"prop"]
gives the property prop of travel directions.
Details and Options
- The locations loci can be geographic entities, GeoPosition objects, or strings specifying addresses.
- Possible options include:
-
TravelMethod "Driving" method of transportation to assume UnitSystem $UnitSystem unit system to be used in output - TravelDirections returns a TravelDirectionsData object, which behaves as a path specification inside GeoGraphics.
- Possible properties prop to request include:
-
"Dataset" Dataset with maneuvers and other data "TravelPath" travel path as a GeoPath primitive "ManeuverGrid" grid of maneuvers "TravelDistance" total distance to travel "TravelTime" total time for travel - TravelDirections attempts to find the fastest path between the loci, not taking traffic into account.
Examples
open all close allBasic Examples (2)
Find directions from New York City to Miami:
td = TravelDirections[{Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Entity["City", {"Miami", "Florida", "UnitedStates"}]}]Show the path as a thick red line:
GeoGraphics[Style[Line[td], Thick, Red]]Get instructions as a dataset:
td["Dataset"][All, {"Description", "Distance"}]Specify a method of transportation, in this case driving by car:
TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, TravelMethod -> "Driving"]Get an estimate of the total travel time:
%["TravelTime"]Scope (5)
Compute travel instructions between two geographic location entities:
td = TravelDirections[{["London"], ["Berlin"]}]td["TravelDistance"]td = TravelDirections[{["London"], ["Berlin"]}, "TravelTime"]Use GeoPosition objects to define locations:
TravelDirections[{GeoPosition[{40.11, -88.24}], GeoPosition[{41.84, -87.69}]}]Compute instructions to travel through a list of locations:
TravelDirections[{Entity["City", {"Lima", "Lima", "Peru"}], GeoPosition[{-14.06, -75.75}], Entity["City", {"Arequipa", "Arequipa", "Peru"}], Entity["City", {"Cusco", "Cusco", "Peru"}]}]Specify locations as addresses:
TravelDirections[{"100 Trade Center Drive, Champaign, Illinois, US", Entity["City", {"Chicago", "Illinois", "UnitedStates"}]}]Options (3)
TravelMethod (1)
TravelDirections uses "Driving" as the default method of transportation:
tddrive = TravelDirections[{Entity["Building", "EmpireStateBuilding::h583b"], Entity["Museum", "MuseumOfModernArt::nfkn8"]}, TravelMethod -> "Driving"]tdwalk = TravelDirections[{Entity["Building", "EmpireStateBuilding::h583b"], Entity["Museum", "MuseumOfModernArt::nfkn8"]}, TravelMethod -> "Walking"]The respective travel paths are different:
GeoGraphics[{tddrive["TravelPath"], Red, tdwalk["TravelPath"]}]UnitSystem (2)
Specify the unit system of the output quantities:
TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, "TravelDistance"]TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, "TravelDistance", UnitSystem -> "Metric"]Extract property values in different unit systems:
td = TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]The default unit system is given by $UnitSystem, usually determined by your location:
td["TravelDistance"]td["TravelDistance", UnitSystem -> "Metric"]Applications (1)
Take major stops of the Camino de Santiago through northern Spain:
locations = {Entity["City", {"SaintJeanPiedDePort", "Aquitaine", "France"}], Entity["City", {"Logrono", "LaRioja", "Spain"}], Entity["City", {"Burgos", "Burgos", "Spain"}], Entity["City", {"Leon", "Leon", "Spain"}], Entity["City", {"SantiagoDeCompostela", "ACoruna", "Spain"}]};Compute travel directions assuming "Walking" as travel method:
td = TravelDirections[locations, TravelMethod -> "Walking"]Draw a map, including markers at the intermediate locations:
GeoGraphics[{td["TravelPath"], GeoMarker[locations]}]Estimate the total distance traveled:
td["TravelDistance", UnitSystem -> "Metric"]Estimate the total time spent, not counting any intermediate stops:
td["TravelTime"]Properties & Relations (2)
The estimated travel time can also be computed with TravelTime:
TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, "TravelTime"]TravelTime[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]The estimated travel distance can also be computed with TravelDistance:
TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, "TravelDistance"]TravelDistance[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"Philadelphia", "Pennsylvania", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]Possible Issues (1)
Traffic restrictions may force different routes when traveling to the locations in reverse order:
locations = {Entity["Building", "EiffelTower::5h9w8"], Entity["HistoricalSite", "ArcDeTriomphe::5bjjr"]};td1 = TravelDirections[locations]td2 = TravelDirections[Reverse[locations]]GeoGraphics[{Blue, td1["TravelPath"], Red, td2["TravelPath"], GeoMarker[locations]}, GeoRange -> Quantity[1, "Miles"]]Travel distances are different:
{td1["TravelDistance"], td2["TravelDistance"]}Tech Notes
Related Guides
History
Text
Wolfram Research (2015), TravelDirections, Wolfram Language function, https://reference.wolfram.com/language/ref/TravelDirections.html.
CMS
Wolfram Language. 2015. "TravelDirections." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TravelDirections.html.
APA
Wolfram Language. (2015). TravelDirections. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TravelDirections.html
BibTeX
@misc{reference.wolfram_2026_traveldirections, author="Wolfram Research", title="{TravelDirections}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/TravelDirections.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_traveldirections, organization={Wolfram Research}, title={TravelDirections}, year={2015}, url={https://reference.wolfram.com/language/ref/TravelDirections.html}, note=[Accessed: 13-June-2026]}