Nov 13, 2021 • Blog

Create Travel Time Isochrones in New GeoJSON Format

facebook iconx icon

Contents

Today we’re announcing that we have added GeoJSON as a new supported response format for the time-map endpointof the TravelTime API. Thetime-mapendpoint lets you create isochrones, allowing you to display all locations that are reachable within a time limit on a map. You can use this to display isochrones within your web app or as part of your location analysis. 

Thetime-mapendpoint by default returns a response in JSON format, but this can now be changed to GeoJSON using the Accept header of a request. While the JSON format for multi-polygons is structured around ‘shells’ and ‘holes’, the GeoJSON format follows the more standardised form of polygons and holes.

Using this more standardised format makes it simpler to parse the response from the TravelTime API.This makes it more straightforward to display isochrones in a web app, such as a property portal or recruitment site, or to add them into desktop tools that accept GeoJSON as an input layer, such as Tableau.

Example GeoJSON response structure
Example GeoJSON response structure

Send a request using GeoJSON

To set the response type to GeoJSON, simply update theAccept header from application/json to application/geo+json

Example time-map request headers using GeoJSON
Example time-map request headers using GeoJSON

To send a test request using the GeoJSON format, make the following Curl request:

Note: you’ll need to enter your own Application ID and API Key in place of the placeholders

Example Use Cases

1. Displaying isochrones in your app or website

The GeoJSON format makes displaying isochrones in a web applicationmuch more straightforward.

Whereas previously the JSON response on shells and holes needed to be parsed to GeoJSON, with the GeoJSON response format, this whole process can be skipped.

Try this out by copying and pasting a GeoJSON response into this application. The response should immediately be displayed as an isochrone on the map, for example:

TravelTime isochrone GeoJSON response
Example of a time-map GeoJSON response being displayed as an isochrone on a web map

2. Loading layers into desktop GIS & analytics tools

GeoJSON is a common format for loading spatial files into desktop analytics applications like Tableau or desktop GIS toolssuch as QGIS and ArcGIS.

For example, we can save a time-map GeoJSON response as a .geojson file and add it straight into a Tableau Desktop worksheet without any configuration required:

GeoJSON response_Tableau Desktop
A time-map GeoJSON response loaded into Tableau Desktop

Similarly, using QGIS we can simply drag and drop the .geojson file onto the map to display the isochrone:

TravelTime GeoJSON response in QGIS
A time-map GeoJSON response loaded into QGIS

Get started

We’re continuously striving to improve the performance and experience of our API, so you can integrate it into your application more easily. As part of this effort, we’ve added GeoJSON as a new accepted response format for thetime-mapendpoint of the TravelTime API.

This change to a more standard format makes interpreting the response significantly easier and makes it more straightforward to display an isochrone on a web page or add it into a desktop GIS tool.

To learn more about what you can do with the TravelTime API,visit our documentationor get in touch

To test the TravelTime API for your project,sign up for a free API key here.

Visualise locations like never before.
Transform journey time data into an unlimited number of dynamic isochrones maps every month, for one fixed price.
Try for free
cta accent icon
facebook iconx icon

Contents

Build travel time polygons and catchment areas with the TravelTime API

Get started free
cta accent icon

Read related articles

featured
Blog post
A New Way to Simplify Error Handling with the TravelTime QGIS Plugin
featured
Blog post
Accurately Calculate Thousands of Cycle Times with a New TravelTime Cycling Model
featured
Blog post
12 New Countries Added to TravelTime's Transport Coverage