Skip to content
GuidesPlaygroundDashboard

Routing

Calculate a route between two points
routing.route(**kwargs) -> RouteResult { geometry, properties, type }
POST/api/v1/route
Snap a coordinate to the nearest road
routing.nearest(**kwargs) -> NearestResult { geometry, properties, type }
GET/api/v1/nearest
Calculate an isochrone from a point
routing.isochrone(**kwargs) -> GeoJsonFeature { geometry, properties, type, 2 more }
GET/api/v1/isochrone
Calculate a distance matrix between points
routing.matrix(**kwargs) -> MatrixResult { distances, durations }
POST/api/v1/matrix
ModelsExpand Collapse
class MatrixRequest { destinations, origins, mode }
destinations: GeoJsonGeometry { coordinates, type }

Destination points (GeoJSON MultiPoint geometry)

coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
origins: GeoJsonGeometry { coordinates, type }

Origin points (GeoJSON MultiPoint geometry)

coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
mode: :auto | :foot | :bicycle

Travel mode

One of the following:
:auto
:foot
:bicycle
class MatrixResult { distances, durations }
distances: Array[Array[Float]]

Distance matrix (meters), origins x destinations

durations: Array[Array[Float]]

Duration matrix (seconds), origins x destinations

class NearestResult { geometry, properties, type }

GeoJSON Point Feature snapped to the nearest road segment

geometry: GeoJsonGeometry { coordinates, type }
coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
properties: { distance_m, edge_id}
distance_m: Float

Distance to nearest road in meters

edge_id: Integer

Road edge ID

type: :Feature
class RouteRequest { destination, origin, mode }
destination: GeoJsonGeometry { coordinates, type }

Destination point (GeoJSON Point geometry)

coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
origin: GeoJsonGeometry { coordinates, type }

Origin point (GeoJSON Point geometry)

coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
mode: :auto | :foot | :bicycle
One of the following:
:auto
:foot
:bicycle
class RouteResult { geometry, properties, type }
geometry: GeoJsonGeometry { coordinates, type }
coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
properties: { distance, duration, mode}
distance: Float

Total distance in meters

duration: Float

Estimated duration in seconds

mode: String

Travel mode used

type: :Feature