MapBox - Directions
Get Distance, Duration and LineString between Two Points
When you input two sets of coordinates (latitude and longitude) into the MapBox Directions tool, it calculates the duration (in seconds) and distance (in meters) between the two points. Additionally, it provides a GeoJSON linestring column representing the route connecting the two points, such as the one below.
You can use the LineString column in visualisation tools to show the route between those two points.
An example of a visualised LineString route
We use MapBox to generate the output of this tool. MapBox has a generous free tier that includes 100.000 monthly requests.
For every row in your dataset you will call a MapBox API. In other words, the tool will take longer time to run with many records. We strongly recommend testing on smaller datasets.
We have built-in restriction to handle rate limits for a single tool. However, you should be cautious if you run multiple models at the same time using the MapBox tool suite.
You are responsible for respecting the Terms of Use specified by MapBox when you use the MapBox - tool.
Configuration
The MapBox - Directions tool consists of seven required input.
Select ID Column
Select a column containing an ID. Use the Row ID to generate one if you don’t have one in your dataset.
Origin Latitude
Select the column containing your origin latitude.
Origin Longitude
Select the column containing your origin longitude.
Destination Latitude
Select the column containing your destination latitude.
Destination Longitude
Select the column containing your destination longitude.
Select Routing Type
Select your routing type. This will determine the duration, distance and linestring column.
Input MapBox API Token
Input your MapBox API Token.
Additional Settings: Input Departure Time
Optional. If you have it enabled in MapBox, you can input a desired departure. When paired with the Driving (Traffic) routing type, this will influence the route, distance and duration.
When To Use
You can use the output from the Mapbox - Directions tool for a wide number of use cases, for instance in logistics and transportation.
- You can use the distance and duration columns to track wear and tear of your vehicle fleet
- You can use the distance columns to estimate emissions of your vehicle fleet
- Find the optimal warehouses depending on your deliveries
- With the departure time setting, you can optimize your routes for the shortest distances or duration