Flying memes

Generate an isochrone map using Google Maps Api

Isochrone maps:

Isochrone maps are pretty useful instruments that shows lines of equivalent drive time or travel time to a given location; they can be used in many statistical research, for example to find out which portion of a city can reach a  given hospital within ten minutes drive. Unfortunately isochrones drawback is that each time you need a map centered on a different location you need to re-craft the isochrone. This lead to a general rarity of these maps on the web.

Luckily you can simulate an isochrone map with just a few lines of code and the Google Map Api. Using the directions service you can scout the neighborhood searching for points that surpass the given time limit from the given location.

There’s a live demo available and a video:

How it works:

The script invoke the google directions service several times for each of the X rays that split the circumference centered on the given location into equiangular slices. Every requests on a ray is made using the given location as a starting point and a point on the ray as a destination. The destination point is set more far from the center after every request. When the route time surpass the given time limit a marker is placed, the exploration phase on every ray goes on until a value greater than (given time limit * 0.5) is found or more than 50 requests has been made.


The sources of this small proof-of-concept are available on my github account.