DEV Community

Cover image for Drawing a drive time polygon on a Google Map: how far you can go in 1 hour or more?
tomastraveltime
tomastraveltime

Posted on

Drawing a drive time polygon on a Google Map: how far you can go in 1 hour or more?

If you've ever wondered 'how far can I drive within 30 minutes?' you're not alone. Hundreds of people each week are looking to discover a way to draw a driving polygon on a Google map. 

Using Google Distance Matrix to make this shape means you'll either need to fire lots of expensive requests to the Google Routing API or you'll end up with a very basic polygon. The tutorial linked below is a walkthrough of how to make this visualization using the TravelTime API. You can sign up for a free trial key from TravelTime without adding your billing details.

The API works by calculating every possible latitude/longitude coordinate that rests on the travel time parameter. You will only need to make 1 API request to visualize a travel time polygon (aka isochrone).  

15 minute driving

15 minute driving travel time polygon using Google Maps & TravelTime API

The shape above is an example of a 15 minute drive time area in Central London. Travel time polygons can be any size from 5 minutes to 4 hours. It's also possible to use the tutorial to create polygons for walking, cycling, public transport, or combined transport modes.  

Use cases

  1. Draw many polygons for 5, 10, 15, 20, 25, 30 mins to see a heat map of where's reachable in different time catchments.
  2. Overlap polygons and visualise where's mutually reachable by two or more start locations.
  3. Combine polygons together. For example draw a 30 minute travel time area around every supermarket in the country. Combining this shapes will polarise the map to see the total accessible zones and total inaccessible zones.

READ TUTORIAL WALKTHROUGH

Top comments (0)