/isochrones-python-apis

Jupyter notebook demonstrating how to create isocrhones using Python and some helpful spatial APIs

Primary LanguageJupyter Notebook

Creating Isochrones with Python and Distance APIs

A Jupyter notebook showing how to use free spatial APIs to create isochrone maps.

I made this for a training session at City Bureau's inaugural Design-A-Thon.

You can view slides for the training here.

Assumptions

Installation

Install Python dependencies

pipenv --three
pipenv install

Running the notebook

pipenv shell
jupyter-notebook Isochrones\ with\ Python\ and\ APIs.ipynb

Geocoding an address

If you just want to geocode one address really quickly, the U.S. Census Bureau Geocoder has a web form. They have another form that lets you geocode all addresses in a CSV file.

There's also an API that lets you geocode individual addresses, or a batch of addresses as CSV.

This API is free to use, but only works for U.S. addresses.

It also seems to be broken right now.

Texas A&M University Geocoder

If you just want to geocode one address, there is an interactive geocoder.

Some API options

Google Maps Distance Matrix API

Developer's Guide

Pros:

  • Supports transit

Cons:

  • Can only be used to display information on a Google Map
  • Have to make multiple queries to query distances along a radius to build isocrhone

HERE Routing API

Quick Start Guide API Reference

Pros:

  • API returns the isochrone itself

Cons:

  • Only supports car and pedestrian modes of transport

Mapbox Distance API

API Documentation

Pros:

  • More permissive uses than Google's API

Cons:

  • Have to make multiple queries to query distances along a radius to build isocrhone
  • Doesn't support transit

Mapzen Isochrone Service

Service description

API documentation

Pros:

  • More permissive uses than Google's API
  • Supports Driving, Cycling, Walking and Transit
  • Response is GeoJSON

Cons:

  • Doesn't incorporate traffic in driving times
  • Doesn't (yet) support arrival time for transit directions

Thanks

To Sahil Chinoy who made these awesome isochrones of leaving metro areas for the weekend and told me about the HERE API.