An isochrone is a line on a map that represents equal travel time from a given location. For example, an isochrone map could show all the areas that can be reached within a 30-minute drive from a central location.

Mundipy supports querying some third-party APIs directly from the library. These third-party APIs require an access token and billing setup, hence they are provided for convenience only.

All calculations are in driving time or distance. Walking or cycling are not implemented.

Calculate isochrones

The isochrone API is provided by Mapbox. They provide 100,000 free monthly requests. You need a Mapbox access token to use this API.

Isochrones of both distance traveled and travel time are available. Let’s take a central point to be a point in Hoboken, New Jersey:

from mundipy.geometry import Point

# specifies <longitude, latitude> with no properties
hoboken = Point((-74.0344, 40.7418), 'EPSG:4326', dict())

And an access token that should remain private:

MAPBOX_ACCESS_TOKEN = '...'

Types of isochrones

Distance traveled

Here we calculate an isochrone to be the region one can travel to without traveling more than 1 km:

from mundipy.api import isochrone

polygon = isochrone(hoboken, 1000., 'meters', accessToken=MAPBOX_ACCESS_TOKEN)

In a Jupyter notebook, polygon would render like this, showing we’ve retrieved a region that represents 1 km driving distance from the central point:

Travel time

Here we calculate an isochrone to be the region one can travel to without driving more than 30 minutes:

from mundipy.api import isochrone

polygon = isochrone(hoboken, 30., 'minutes', accessToken=MAPBOX_ACCESS_TOKEN)

In a Jupyter notebook, polygon would render like this, capturing much of New Jersey and New York: