---
title: "TravelDistance"
language: "en"
type: "Symbol"
summary: "TravelDistance[{loc1, loc2, ...}] gives the estimated distance for travel from loc1 to loc2, ...."
keywords: 
- distance
- travel distance
- directions
- travel directions
- trip
- signal
- signpost
- guide
- address
- geo travel
- geo directions
- routing
- route
canonical_url: "https://reference.wolfram.com/language/ref/TravelDistance.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Locations, Paths, and Routing"
    link: "https://reference.wolfram.com/language/guide/LocationsPathsAndRouting.en.md"
  - 
    title: "Geodesy"
    link: "https://reference.wolfram.com/language/guide/Geodesy.en.md"
  - 
    title: "Transportation Data"
    link: "https://reference.wolfram.com/language/guide/TransportationData.en.md"
  - 
    title: "Distance and Similarity Measures"
    link: "https://reference.wolfram.com/language/guide/DistanceAndSimilarityMeasures.en.md"
  - 
    title: "Maps & Cartography"
    link: "https://reference.wolfram.com/language/guide/MapsAndCartography.en.md"
related_functions: 
  - 
    title: "TravelDistanceList"
    link: "https://reference.wolfram.com/language/ref/TravelDistanceList.en.md"
  - 
    title: "TravelDirections"
    link: "https://reference.wolfram.com/language/ref/TravelDirections.en.md"
  - 
    title: "TravelTime"
    link: "https://reference.wolfram.com/language/ref/TravelTime.en.md"
  - 
    title: "GeoDistance"
    link: "https://reference.wolfram.com/language/ref/GeoDistance.en.md"
  - 
    title: "GeoDistanceList"
    link: "https://reference.wolfram.com/language/ref/GeoDistanceList.en.md"
  - 
    title: "Interpreter"
    link: "https://reference.wolfram.com/language/ref/Interpreter.en.md"
  - 
    title: "Entity"
    link: "https://reference.wolfram.com/language/ref/Entity.en.md"
  - 
    title: "GeoPosition"
    link: "https://reference.wolfram.com/language/ref/GeoPosition.en.md"
  - 
    title: "Quantity"
    link: "https://reference.wolfram.com/language/ref/Quantity.en.md"
  - 
    title: "CityData"
    link: "https://reference.wolfram.com/language/ref/CityData.en.md"
---
# TravelDistance

TravelDistance[{loc1, loc2, …}] gives the estimated distance for travel from loc1 to loc2, ….

## 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   |

* ``TravelDistance[loc1, loc2]`` is equivalent to ``TravelDistance[{loc1, loc2}]``.

* ``TravelDistance[loc2, loc1]`` is not necessarily the same as ``TravelDistance[loc1, loc2]`` as a result of one-way streets and similar issues.

---

## Examples (9)

### Basic Examples (1)

Compute an estimation of the total distance of a trip:

```wl
In[1]:= TravelDistance[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]

Out[1]= Quantity[1276.8974955012727, "Miles"]
```

### Scope (4)

Distance to travel between two geographic locations:

```wl
In[1]:= TravelDistance[{Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}], Entity["City", {"Berlin", "Berlin", "Germany"}]}]

Out[1]= Quantity[679.8776016811819, "Miles"]
```

---

Use ``GeoPosition`` objects to define locations:

```wl
In[1]:= TravelDistance[{GeoPosition[{40.11, -88.24}], GeoPosition[{41.84, -87.69}]}]

Out[1]= Quantity[131.5241334357353, "Miles"]
```

---

Compute distance to travel through several locations:

```wl
In[1]:= TravelDistance[{Entity["City", {"Lima", "Lima", "Peru"}], GeoPosition[{-14.06, -75.75}], Entity["City", {"Arequipa", "Arequipa", "Peru"}], Entity["City", {"Cusco", "Cusco", "Peru"}]}]

Out[1]= Quantity[995.1482038644317, "Miles"]
```

---

Specify locations as addresses:

```wl
In[1]:= TravelDistance[{"100 Trade Center Drive, Champaign, Illinois, US", Entity["City", {"Chicago", "Illinois", "UnitedStates"}]}]

Out[1]= Quantity[132.11083522230177, "Miles"]
```

### Options (2)

#### TravelMethod (1)

``TravelDistance`` uses ``"Driving"`` as default method of transportation:

```wl
In[1]:= TravelDistance[{Entity["Building", "EmpireStateBuilding::h583b"], Entity["Museum", "MuseumOfModernArt::nfkn8"]}, TravelMethod -> "Driving"]

Out[1]= Quantity[1.6163716396245922, "Miles"]
```

Use ``"Walking"`` instead:

```wl
In[2]:= TravelDistance[{Entity["Building", "EmpireStateBuilding::h583b"], Entity["Museum", "MuseumOfModernArt::nfkn8"]}, TravelMethod -> "Walking"]

Out[2]= Quantity[1.1015345382963493, "Miles"]
```

#### UnitSystem (1)

The default unit system is given by ``\$UnitSystem``, usually determined by your location, in this case ``"Imperial"`` :

```wl
In[1]:= TravelDistance[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]

Out[1]= Quantity[1276.8974955012727, "Miles"]
```

Specify the unit system of the result:

```wl
In[2]:= TravelDistance[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, UnitSystem -> "Metric"]

Out[2]= Quantity[2054.9673230000003, "Kilometers"]
```

### Properties & Relations (2)

Compute the estimated travel distance between two locations:

```wl
In[1]:= TravelDistance[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]

Out[1]= Quantity[1276.8974955012727, "Miles"]
```

It can also be computed with ``TravelDirections`` :

```wl
In[2]:= TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, "TravelDistance"]

Out[2]= Quantity[1276.8974955012727, "Miles"]
```

Or as a property of a ``TravelDirectionsData`` object:

```wl
In[3]:= TravelDirections[{Entity["City", {"Miami", "Florida", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]

Out[3]= TravelDirectionsData[«2»]

In[4]:= %["TravelDistance"]

Out[4]= Quantity[1276.8974955012727, "Miles"]
```

---

Compute the distances between consecutive pairs of locations:

```wl
In[1]:= list = {Entity["City", {"Madrid", "Madrid", "Spain"}], Entity["City", {"Paris", "IleDeFrance", "France"}], Entity["City", {"Vienna", "Vienna", "Austria"}], Entity["City", {"Berlin", "Berlin", "Germany"}]};

In[2]:= TravelDistanceList[list]//Normal

Out[2]= {Quantity[786.4874638361966, "Miles"], Quantity[767.4313602312494, "Miles"], Quantity[417.66516419112384, "Miles"]}
```

They can also be obtained by combining ``Partition`` and ``TravelDistance``, though less efficiently:

```wl
In[3]:= TravelDistance@@@Partition[list, 2, 1]

Out[3]= {Quantity[786.4874638361966, "Miles"], Quantity[767.4313602312494, "Miles"], Quantity[417.6651635697527, "Miles"]}
```

## See Also

* [`TravelDistanceList`](https://reference.wolfram.com/language/ref/TravelDistanceList.en.md)
* [`TravelDirections`](https://reference.wolfram.com/language/ref/TravelDirections.en.md)
* [`TravelTime`](https://reference.wolfram.com/language/ref/TravelTime.en.md)
* [`GeoDistance`](https://reference.wolfram.com/language/ref/GeoDistance.en.md)
* [`GeoDistanceList`](https://reference.wolfram.com/language/ref/GeoDistanceList.en.md)
* [`Interpreter`](https://reference.wolfram.com/language/ref/Interpreter.en.md)
* [`Entity`](https://reference.wolfram.com/language/ref/Entity.en.md)
* [`GeoPosition`](https://reference.wolfram.com/language/ref/GeoPosition.en.md)
* [`Quantity`](https://reference.wolfram.com/language/ref/Quantity.en.md)
* [`CityData`](https://reference.wolfram.com/language/ref/CityData.en.md)

## Related Guides

* [Locations, Paths, and Routing](https://reference.wolfram.com/language/guide/LocationsPathsAndRouting.en.md)
* [`Geodesy`](https://reference.wolfram.com/language/guide/Geodesy.en.md)
* [Transportation Data](https://reference.wolfram.com/language/guide/TransportationData.en.md)
* [Distance and Similarity Measures](https://reference.wolfram.com/language/guide/DistanceAndSimilarityMeasures.en.md)
* [Maps & Cartography](https://reference.wolfram.com/language/guide/MapsAndCartography.en.md)

## Related Links

* [An Elementary Introduction to the Wolfram Language: Geocomputation](https://www.wolfram.com/language/elementary-introduction/18-geocomputation.html)

## History

* [Introduced in 2015 (10.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn103.en.md)