Tutorials and hands-on lessons for learning

Utilizing travel time as a proxy for distance


Thus far, each of the tools that we’ve discussed measure spherical-line distances. However, network analyses substitute travel time for distance by taking into account the cost (in time) of traveling along a networked path such as a road. The following examples illustrate tools that can be used for distance analyses that take into account road networks and travel times.

Measuring the distance between points (one-to-one)


A shop or restaurant may seem close in ‘as the crow flies’ distance, but the actual distance as travel time may change greatly when you take into consideration network constraints such as travel modes (e.g. walking, driving), traffic congestion, road closures, one-way streets, etc. To determine the actual distance as travel time from point A to point B, you will need to add these constraints to your analysis. The Mapbox Directions API calculates the optimal distance between two points by incorporating weights to the analysis such as road network and traffic information for multiple travel modes including driving, walking, and cycling.

Measuring the distance between points (one-to-many)


Let's say that you are on a road trip and you are running out of gas. There are 4 gas stations within a 1 kilometer radius - how do you determine which one is the fastest to get to? Or perhaps you are ride share service and you four cars within less than a mile of a customer. How do you determine which car is the closest for pick up?

The Mapbox Matrix API calculates travel times between many points in one API request. The API returns travel times between many locations and is designed specifically for building a timetable or matrix. The number of sources and destinations are multiplied to create the matrix, or timetable, and calculate the number of elements needed to make the request. For example, given 3 locations — A, B, and C — the Matrix API will return a matrix of all travel times in seconds between all the locations:

Selecting within a distance (one to many)


Tools like the Mapbox Isochrone API relay information about temporal proximity by calculating areas that are reachable within a specified amount of time from a location and returning the reachable regions as contours of polygons or lines that you can display on a map. The results can be refined by routing profiles such as walking for pedestrian and hiking travel times, cycling for travel times by bicycle, or driving for travel times by car. You can use isochrones to define service or catchment areas for hospitals or schools or identify amenities within a 15 minute drive-time.

Review questions

  1. How does a network analysis differ from straight-line or spherical distance analysis?
  2. What are the different type of routing profiles available
Was this page helpful?