Zum Inhalt springen

Isochronen (`/isochrone`)

Beantwortet die Frage „was erreiche ich von hier aus in n Minuten?” — als Fläche, nicht als Route.

POST https://valhalla.pixelmap.at/isochrone

Was ist von Klagenfurt aus in 10 und in 20 Autominuten erreichbar?

Terminal-Fenster
curl -H "Authorization: Bearer <IHR-TOKEN>" -X POST -H "Content-Type: application/json" \
-d '{
"locations": [{"lat": 46.6247, "lon": 14.3053}],
"costing": "auto",
"contours": [{"time": 10}, {"time": 20}],
"polygons": true
}' \
"https://valhalla.pixelmap.at/isochrone"

Eine GeoJSON-FeatureCollection — ein Feature je Kontur, direkt in eine Karte einsetzbar:

{
"type": "FeatureCollection",
"features": [
{ "properties": { "contour": 20.0, "metric": "time", "color": "#bf4040", "fill": "#bf4040", "fill-opacity": 0.33 },
"geometry": { "type": "Polygon", "coordinates": [ … ] } },
{ "properties": { "contour": 10.0, "metric": "time", … } }
]
}

Die Farbangaben (color, fill, fill-opacity) liefert der Dienst mit; Sie können sie übernehmen oder ignorieren.

Statt time nimmt contours auch distance (in Kilometern):

"contours": [{"distance": 5}, {"distance": 10}]

Das Feld metric in der Antwort sagt, welches von beiden gerechnet wurde.

"polygons": true liefert Flächen (Polygon). Ohne die Angabe kommen Linienzüge (LineString) — dieselbe Grenze, aber nicht füllbar. Für eine eingefärbte Erreichbarkeitsfläche brauchen Sie polygons: true.

Eine Isochrone ist ein Modell, kein Fahrplan. Sie rechnet mit den Geschwindigkeiten des Wegenetzes, nicht mit der Verkehrslage von heute Nachmittag. Für ÖPNV-Erreichbarkeit ist sie das falsche Werkzeug — dafür gibt es MOTIS mit echten Fahrplandaten.