Blog
How to Create a GeoJSON Isochrone with the TravelTime API
Contents
An isochrone shows everywhere you can reach within a travel time limit. GeoJSON is the standard way to move that shape between systems — into a web map, a GIS tool, or a spatial database.
The TravelTime API returns isochrones as GeoJSON natively. No conversion step, no parsing shells and holes into polygons yourself. This guide covers what GeoJSON is, how to request an isochrone in that format, and what you can do with the response.
What is GeoJSON?
GeoJSON is a specification for representing geographic data in JSON. Plain JSON containing latitude and longitude values isn't map-ready — mapping libraries and GIS tools expect coordinates arranged according to the GeoJSON structure of features, geometries and coordinate arrays.
Because it's an open standard, almost every mapping library and spatial tool reads it without configuration.
What is an isochrone?
An isochrone is a shape covering all locations reachable within a set travel time, from an origin, by a chosen mode of transport, at a chosen time.
For example: everywhere reachable within 45 minutes departing Times Square, Manhattan at 1pm on a weekday via public transit. The shape follows the road and public transport network, so it looks nothing like a radius circle — it stretches along fast corridors and stops short where the network thins out.
Read more on what isochrones are and how you can use them here.
Why request isochrones as GeoJSON
The TravelTime time-map endpoint returns JSON by default. That format describes multi-polygons in terms of shells and holes:
- Shells — the linear ring of coordinates that defines the outer boundary of the reachable area.
- Holes — areas inside the boundary that aren't reachable within the time limit, given as separate coordinate rings to cut out.
That structure is accurate, but it isn't what mapping libraries expect. Previously you had to parse it into GeoJSON yourself before you could render anything.
GeoJSON follows the standardised form of polygons and interior rings, so the response drops straight into whatever you're using. Less parsing code to write, less to maintain.
Request an isochrone in GeoJSON format
Set the Accept header on your time-map request from application/json to application/geo+json.
Using curl
Replace the placeholders with your own Application ID and API Key. You can get a free API key here.
Using the Node.js SDK
The same applies through the SDKs — provide your credentials, set your isochrone parameters, and specify the GeoJSON output format.
Full parameter reference is in the isochrone endpoint documentation.
What to do with the response
Display isochrones in a web app
Because the response is already GeoJSON, rendering it is a single step. Copy a response into geojson.io and the shape appears on the map immediately — a quick way to sanity-check a request before you write any front-end code.
In production, the same response works directly with the major mapping libraries:
- Leaflet
- Google Maps
- OpenLayers
- Mapbox GL JS
This is the usual path for displaying isochrones in a property portal, recruitment site, or any search interface where users filter by commute.
Load layers into GIS and analytics tools
Save the response as a .geojson file and it opens in desktop GIS and analytics tools with no configuration:
- QGIS — drag and drop the file onto the map canvas
- ArcGIS — add as a layer
- Tableau Desktop — add straight into a worksheet as a spatial file
- PostGIS — load with ogr2ogr for spatial queries against your own datasets
Frequently asked questions
What is GeoJSON?
GeoJSON is an open specification for representing geographic data in JSON. It structures coordinates into features and geometries — points, lines and polygons — so that mapping libraries and GIS tools can read them without conversion. Plain JSON containing latitude and longitude values isn't map-ready until it follows this structure.
What is an isochrone?
An isochrone is a shape covering every location reachable within a given travel time from a single origin. It's defined by four inputs: the origin coordinates, the time limit, the mode of transport, and the departure or arrival time. Because it follows the actual road and transport network, an isochrone is an irregular shape rather than a circle.
How do I get a GeoJSON response from the TravelTime API?
Set the Accept header on your time-map request to application/geo+json instead of application/json. Nothing else about the request changes. The response comes back as a GeoJSON feature collection, ready to render.
Does the TravelTime API return GeoJSON by default?
No. The default response format is application/json, which describes multi-polygons as shells and holes. GeoJSON is opt-in via the Accept header.
What's the difference between shells and holes and GeoJSON polygons?
They describe the same geometry in different structures. TravelTime's default JSON uses shells for the outer boundary of the reachable area and holes for unreachable pockets inside it. GeoJSON expresses this as a polygon with interior rings — the standardised form that mapping libraries expect. Requesting GeoJSON means you don't have to translate between the two.
Which tools can display a GeoJSON isochrone?
Most mapping libraries and spatial tools read GeoJSON natively, including Leaflet, Google Maps, OpenLayers and Mapbox GL JS on the web, and QGIS, ArcGIS, Tableau and PostGIS on the desktop or server side. You can also paste a response into geojson.io to check a shape instantly.
Get started
Requesting isochrones as GeoJSON removes the conversion layer between the API and your map. One header, and the response is ready for whatever consumes it.
To test it on your own project, sign up for a free API key or read the documentation. If you'd like to talk through your use case, get in touch.
Contents
Related content