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.

{"type": "LineString", "coordinates": [[12.57008, 55.675948], [12.573047, 55.674432], [12.572279, 55.673675], [12.537692, 55.690563], [12.519615, 55.701987], [12.54859, 55.725869], [12.522627, 55.753249], [12.533087, 55.80623], [12.523868, 55.831668], [12.483907, 55.867342], [12.471698, 55.908795], [12.487743, 55.964208], [12.492576, 55.9669], [12.496228, 55.967014], [12.525585, 55.96453], [12.534182, 55.961745], [12.540634, 55.970085], [12.542079, 55.969075]]}

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.

1

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.

2

Origin Latitude

Select the column containing your origin latitude.

3

Origin Longitude

Select the column containing your origin longitude.

4

Destination Latitude

Select the column containing your destination latitude.

5

Destination Longitude

Select the column containing your destination longitude.

6

Select Routing Type

Select your routing type. This will determine the duration, distance and linestring column.

7

Input MapBox API Token

Input your MapBox API Token.

8

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

Examples