Skip to content
GuidesPlaygroundDashboard

Routing

Calculate a route between two points
routing.route(RoutingRouteParams**kwargs) -> RouteResult
POST/api/v1/route
Snap a coordinate to the nearest road
routing.nearest(RoutingNearestParams**kwargs) -> NearestResult
GET/api/v1/nearest
Calculate an isochrone from a point
routing.isochrone(RoutingIsochroneParams**kwargs) -> GeoJsonFeature
GET/api/v1/isochrone
Calculate a distance matrix between points
routing.matrix(RoutingMatrixParams**kwargs) -> MatrixResult
POST/api/v1/matrix
ModelsExpand Collapse
class MatrixRequest:
destinations: GeoJsonGeometry

Destination points (GeoJSON MultiPoint geometry)

coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"

Origin points (GeoJSON MultiPoint geometry)

coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
mode: Optional[Literal["auto", "foot", "bicycle"]]

Travel mode

One of the following:
"auto"
"foot"
"bicycle"
class MatrixResult:
distances: List[List[Optional[float]]]

Distance matrix (meters), origins x destinations

durations: List[List[Optional[float]]]

Duration matrix (seconds), origins x destinations

class NearestResult:

GeoJSON Point Feature snapped to the nearest road segment

geometry: GeoJsonGeometry
coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: Properties
distance_m: Optional[float]

Distance to nearest road in meters

edge_id: Optional[int]

Road edge ID

type: Literal["Feature"]
class RouteRequest:
destination: GeoJsonGeometry

Destination point (GeoJSON Point geometry)

coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"

Origin point (GeoJSON Point geometry)

coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
mode: Optional[Literal["auto", "foot", "bicycle"]]
One of the following:
"auto"
"foot"
"bicycle"
class RouteResult:
geometry: GeoJsonGeometry
coordinates: Union[List[float], List[List[float]], List[List[List[float]]], List[List[List[List[float]]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List[float]
List[List[float]]
List[List[List[float]]]
List[List[List[List[float]]]]
type: Literal["Point", "LineString", "Polygon", 3 more]
One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: Properties
distance: Optional[float]

Total distance in meters

duration: Optional[float]

Estimated duration in seconds

mode: Optional[str]

Travel mode used

type: Literal["Feature"]