Isochrones
GET /v1/isochrone answers everywhere reachable from a point within a travel time — ten minutes' drive, twenty minutes' walk. The answer is a set of cells of one size, each with the earliest time it is reached, and the outline of those cells as rings you can draw.
curl -G "https://api.oslew.com/v1/isochrone" \
-H "Authorization: Bearer $GEO_API_KEY" \
--data-urlencode 'at=19.4326,-99.1332' \
--data-urlencode 'seconds=300' \
--data-urlencode 'level=13'from oslew import Client
# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")
answer = client.isochrone("19.4326,-99.1332", seconds=300, level=13)import { Client } from "@oslew/client";
// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });
const answer = await client.isochrone("19.4326,-99.1332", { seconds: 300, level: 13 });HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 296
ratelimit-reset: 1
{
"at": [
19.4326,
-99.1332
],
"snapped": {
"node": 355496,
"lat": 19.432020221186303,
"lon": -99.13343108985583,
"distance_m": 68.87232944392214
},
"seconds": 300,
"level": 13,
"cells": [
{
"cell": 9642761832233959424,
"seconds": 281.3,
"bbox": [
19.420689096751655,
19.455007845688197,
-99.17874350782816,
-99.14569912676049
]
},
{
"cell": 9642761866593697792,
"seconds": 192.1,
"bbox": [
19.421249347442334,
19.455567629601948,
-99.16767178301049,
-99.13462893139146
]
},
{
"cell": 9642762141471604736,
"seconds": 296.5,
"bbox": [
19.445940704223943,
19.480259193598762,
-99.1455329228977,
-99.11249313370506
]
},
{
"cell": 9642762210191081472,
"seconds": 192.4,
"bbox": [
19.433594973351948,
19.467913360473943,
-99.15660158764146,
-99.1235602666477
]
},
{
"cell": 9642762244550819840,
"seconds": 81.8,
"bbox": [
19.421808845778784,
19.456126660986374,
-99.15660158764146,
-99.1235602666477
]
}
],
"polygon": [
[
[
19.468714017066482,
-99.1345465947727
],
[
19.456927032348943,
-99.1345465947727
],
[
19.4563677158633,
-99.14561525951646
],
[
19.444581301476948,
-99.14561525951646
],
[
19.444021517563197,
-99.15668545488549
],
[
19.4434609809067,
-99.16775717970316
],
[
19.431675424876655,
-99.16775717970316
],
[
19.41989015733076,
-99.16775717970316
]
]
],
"engine": "base/hierarchy",
"provenance": {
"name": "overture-transportation",
"release": "2026-08-19.0",
"license": "ODbL-1.0"
},
"took_us": 927
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call. Shortened for the page: cells shows 5 of 24. Shortened for the page: polygon.0 shows 8 of 26.
Five minutes' drive from the Zócalo at level 13, cells of about 1.2 km. The whole answer is 24 cells and one ring of 26 corners; this page shows the first five cells and eight corners. Of the five shown, one is reached in 81.8 s and another only at 296.5 s, just inside the budget.
Parameters
| Parameter | Default | Is |
|---|---|---|
at | required | The starting point, lat,lon. |
seconds | 600 | The time budget, clamped to 1–3,600 — at most an hour. |
level | 14 (≈ 600 m) | The size of the cells, clamped to 8–16. Below. |
profile | driving | driving, walking, cycling, rail or live; see routes and profiles. |
traffic | none | live for a traffic feed's weights, driving only; see live traffic. |
How it is worked out
atis moved to its nearest road junction in the profile's network —snapped, with how far it moved indistance_m. More than about 9 km from any road is a400,no road within 9 km. The time fromatto that junction is not counted.- Every junction reachable from there within
secondsis found, each with its earliest arrival. - Each of those junctions falls in one cell at
level. A cell is in the answer if anyjunction in it was reached, and itssecondsis the earliest arrival at any of them. - The outline of the cells is traced into rings: the
polygon.
Two things follow. The outline is generous by up to a cell: a cell counts as reached if any junction in it was, so the edge of an isochrone is the edge of the cells, not of the roads. And a cell with no junction in it — a park, a lake, a block between two junctions far apart — is never reached, so fine levels show holes where there are no roads. It is fast: a ten-minute drive takes about 1.2 ms of server time.
Choosing a level
Each level's cells are half the width of the level before. The ones worth using:
| Level | Cells about | Suits |
|---|---|---|
| 12 | 2 km | An hour's drive; a region at a glance. |
| 13 | 1.2 km | Ten to thirty minutes' drive. |
| 14 | 600 m | The default. A short drive, or a long walk or ride. |
| 15 | 300 m | A walk of ten or twenty minutes. |
| 16 | 150 m | A short walk, drawn at street scale. |
A coarser level is fewer cells, a smoother outline with fewer holes, and a smaller answer — cell count grows four times with each level finer for the same area. A finer level follows the roads more closely and shows every gap between them. Pick the coarsest level that still looks right at the zoom you draw it. Levels are explained incells and levels.
The cells
| Field of each cell | Is |
|---|---|
cell | The cell's id, a 64-bit integer. Cells come in ascending order of id, not of time. |
seconds | The earliest arrival at any road junction in the cell, to a tenth of a second. |
bbox | [lat_lo, lat_hi, lng_lo, lng_hi]: a box that certainly contains the cell, padded by about the cell's own width on every side. |
Use seconds for "how soon is this area reached". For "can I reach this address within ten minutes", ask about the address itself — a matrix row or a route— which answers for that point rather than for the cell it happens to fall in.
The outline
polygon is a list of rings, each a list of [lat, lon] corners along the cells' edges. An isochrone can come back as several rings: islands of reach whose cells do not touch — along a fast road with junctions far apart, say — and holes, which are rings too. What the rings are not:
- Not labelled. Nothing says which ring is an outline and which is a hole. A ring inside an odd number of other rings is a hole.
- Not closed. The last corner is not a repeat of the first; GeoJSON wants it to be.
- Not
[lon, lat]. Swap every pair for GeoJSON.
Drawing it on a map
This turns polygon into a GeoJSON MultiPolygon that any map library will draw, holes and all:
type LatLon = [number, number];
/** An isochrone's rings as a GeoJSON Feature: [lon, lat], closed, holes inside their outline. */
function isochroneToGeoJSON(polygon: LatLon[][]) {
const rings = polygon.map((ring) => {
const r = ring.map(([lat, lon]) => [lon, lat]);
return [...r, r[0]];
});
const inside = ([x, y]: number[], ring: number[][]) => {
let hit = false;
for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {
const [xi, yi] = ring[i], [xj, yj] = ring[j];
if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) hit = !hit;
}
return hit;
};
// Test the middle of each ring's first side: two rings never share a side.
const probe = (r: number[][]) => [(r[0][0] + r[1][0]) / 2, (r[0][1] + r[1][1]) / 2];
const depth = rings.map((r, i) => rings.filter((o, k) => k !== i && inside(probe(r), o)).length);
const outlines = rings.map((_, i) => i).filter((i) => depth[i] % 2 === 0);
const polygons = outlines.map((i) => [rings[i]]);
rings.forEach((r, i) => {
if (depth[i] % 2 === 0) return;
const k = outlines.findIndex((o) => depth[o] === depth[i] - 1 && inside(probe(r), rings[o]));
if (k >= 0) polygons[k].push(r);
});
return { type: "Feature", properties: {}, geometry: { type: "MultiPolygon", coordinates: polygons } };
}def isochrone_to_geojson(polygon):
"""An isochrone's rings as a GeoJSON Feature: [lon, lat], closed, holes inside their outline."""
rings = [[[lon, lat] for lat, lon in ring] for ring in polygon]
rings = [r + [r[0]] for r in rings]
def inside(p, ring):
x, y, hit = p[0], p[1], False
for (xi, yi), (xj, yj) in zip(ring, ring[-1:] + ring[:-1]):
if (yi > y) != (yj > y) and x < (xj - xi) * (y - yi) / (yj - yi) + xi:
hit = not hit
return hit
# Test the middle of each ring's first side: two rings never share a side.
probe = lambda r: [(r[0][0] + r[1][0]) / 2, (r[0][1] + r[1][1]) / 2]
depth = [sum(inside(probe(r), o) for k, o in enumerate(rings) if k != i) for i, r in enumerate(rings)]
outlines = [i for i in range(len(rings)) if depth[i] % 2 == 0]
polygons = [[rings[i]] for i in outlines]
for i, r in enumerate(rings):
if depth[i] % 2:
for k, o in enumerate(outlines):
if depth[o] == depth[i] - 1 and inside(probe(r), rings[o]):
polygons[k].append(r)
break
return {"type": "Feature", "properties": {},
"geometry": {"type": "MultiPolygon", "coordinates": polygons}}The rings' winding order is whatever the tracing produced. Map libraries do not mind; if a validator insists on RFC 7946's order — outlines anticlockwise, holes clockwise — rewind the result with a library such as@turf/rewind. Fetch the isochrone on your server and send the GeoJSON to the browser, not the key.
Several bands
For bands — five, ten and fifteen minutes in three shades — ask three times, once per budget, and draw the largest first. Each is one request and one token. Colouring one answer's cells by seconds looks tempting but needs each cell's outline, which the answer does not carry.
Profiles and live traffic
Every profile works: profile=walking for a walk-in catchment, cycling for a ride.profile=live or traffic=live reaches out over the live traffic weights where an operator has applied a feed, and over the release's where none is; engine says which answered. Acommute-time map puts isochrones to work.