How to Create Isochrones with Postman and the Traveltime API

by Evelina Bezubec
on Nov 4, 2019

The Postman tool can be used to make API requests. We have organised TravelTime API endpoints into collections so you can select the request you need to make and run it quickly. The tutorial below discusses just the Time Map endpoint. This endpoint outputs a list of coordinates that shows the perimeter of where’s reachable within a travel time limit. These coordinates can be used to display a travel time polygon on a map.

 

What is a travel time polygon?

The image below is a visualisation of a travel time polygon showing all locations that are reachable within a 30 minute travel time from London’s Trafalgar Square assuming the user departs the origin at 11.30pm. It displays every possible location you could reach within the 30-minute time slot. The request you’re about to make is quite like a blueprint of the shape below, describing the coordinates needed to draw the dark pink outline.

 

postman-isochrone

Getting started

To begin, make sure you have Postman downloaded and have imported our collection. Follow these instructions: 

  1. Download Postman here
  2. Open Postman once it's downloaded 
  3. With Postman open, click import and then import from link
  4. Paste this link to the Postman collection https://www.getpostman.com/collections/c998ebcd8a4c721587c5 into URL input
  5. Click import

Once you’ve completed the step above, click Time Map and navigate over to the ‘Headers’ tab. You’ll see two empty boxes. One is for the API application ID and the other is for the API.  

image13-1

If you followed the previous tutorial, you will have an email showing your API keys. Get keys here, if not. The shorter set of characters you received in the email is the API ID and the longer set is for the key. Paste these values in the two empty boxes ‘X-Application-Id’ and X-Api-Key’. 

Now navigate over to the body tab as indicated by the orange box.

image6-5

Search types: departure and arrival 

The code shows one departure request (top orange arrow) and one arrival request (bottom orange arrow). A departure request shows where is reachable, assuming you depart your origin location at a set time. For example you may depart a location at 5pm, and travel a maximum of 30 minutes, so the points returned will show the perimeter of all the places you can reach before 5.30pm. The standard postman assumes you need to depart at the time you make the search. 

The arrival request assumes the reverse - you must arrive at your origin at the specified time. For example, if you want to arrive at your origin location at 5pm, and travel a maximum of 30 minutes, the points returned will show the perimeter of all the places you can depart at 4.30pm to arrive at the origin at 5 pm or earlier.  

These are two different requests within a single API call. It means you get two lots of information:

  • The latitude and  longitude coordinates for the perimeter of the departure search polygon
  •  The  latitude and  longitude coordinates for the perimeter of the arrival search polygon

The image below is a visualisation of what you get back if you plotted the coordinates on a map. The blue shows the perimeter of an arrival search and the pink shows the departure search. 

isochrone-arrival-departure

Editing your request

The first thing you will need to do is edit the blue text showing the id. Please make sure that each id is unique, as otherwise, it won’t work. This means the departure and arrival id must be different.

image11

Geocoding

You’ll then need coordinates for your “lat” and “long” fields. The API only accepts a point of origin as coordinates rather than a full address or place name. You can enter a location and get a place name by using our free geocoding tool here

Image below shows example of free geocoding demo - click here to get coordinates

Screen Shot 2019-12-16 at 13.39.03

Things to watch out for when using coordinates:

  • Include the comma after the initial latitude coordinate
  • Make sure to use the minus symbol when the coordinate requires it, it will say this within the geocoding tool above 

Transport modes

You then will need to select the mode of transport you wish to use. The shape looks completely different when exploring where’s reachable within a travel time limit depending on which you select. 

Choose from these options: 

  • cycling
  • driving
  • public_transport
  • walking
  • coach
  • bus
  • train
  • ferry
  • driving+ferry
  • cycling+ferry 

We also have specific modes for certain countries:

  • Great Britain only:  driving+train
  • Netherlands only: cycling+public_transport 

Time of travel 

image3

This part of the code shows the following:

  • The departure time and date in extended ISO-8601 format (YYYY-MM-DDT00:00Z)
  • The maximum travel time area listed in seconds. The example above is 15 minutes (900 seconds / 60 seconds in a minute)

This example below shows 30th October 2019 at 11.30pm (23:30). It also has a maximum travel time area of 30 minutes (30*60 seconds)

image4

Now click the send button. This will run your request and you’ll see the response box below your request change. 

image8-5

What you will get back

Assuming the request was successful, your request should return a long list of lat/long coordinates like the image below. It is also possible you will get an error. To learn more about the error you made have a look at the documentation error codes. 

image5

 

Click

 

Related

Google Maps Drive Time Polygon Tutorial: A Guide to Driving Radius

Visualise ‘how far can I travel’ on a Google Map within a drive time limit, for example a 30 minute driving radius. Follow the free developer guide using an API or use our quick tool to build without code.

Evelina Bezubec Sep 11, 2020
READ

Creating Isochrones Using Alteryx & Tableau (Part 2)

Use isochrones for tableau spatial analysis. Create a polygon to see where's reachable within a travel time limit. Useful for site selection and more.

Chris Hutchinson May 25, 2020
READ

Creating Isochrones Using Alteryx & Tableau (Part 1)

Tutorial of how to prepare isochrone data using Alteryx to visualise using Tableau. Useful for site selection, network analysis or field management.

Chris Hutchinson May 25, 2020
READ

Creating a Population Radius Using TravelTime

Catchment area analysis: a distance-based radius doesn’t reflect accessibility to the location. TravelTime allows search based on time instead of distance.

Chris Hutchinson Feb 17, 2020
READ

Use this Travel Time Calculator to Discover Journey Times

Explore travel time calculator tools. Calculate travel times globally. Optimise your journey using time instead of distance.

Evelina Bezubec Aug 1, 2019
READ

A Step by Step Guide to Free Geocoding for Leaflet

Geocoding for Leaflet. Learn how to use a geocoder that is Leaflet-compatible. Convert addresses and postcodes into coordinates to be displayed on a Leaflet map.

Louisa Bainbridge May 7, 2019
READ