Skip to content
GuidesBlogPlaygroundDashboard

Routing

Calculate a route between two points
$client->routing->route(Destination destination, Origin origin, ?string format, ?int alternatives, ?bool annotations, ?\Datetime departAt, ?Ev ev, ?string exclude, ?Geometries geometries, ?Mode mode, ?Overview overview, ?bool steps, ?TrafficModel trafficModel, ?list<Waypoint> waypoints): RouteResult
POST/api/v1/route
Snap a coordinate to the nearest road
$client->routing->nearest(float lat, float lng, ?string outputFields, ?string outputInclude, ?int outputPrecision, ?int radius): NearestResult
GET/api/v1/nearest
Snap a coordinate to the nearest road
$client->routing->nearestPost(float lat, float lng, ?string outputFields, ?string outputInclude, ?int outputPrecision, ?int radius): NearestResult
POST/api/v1/nearest
Calculate an isochrone from a point
$client->routing->isochrone(float lat, float lng, float time, ?string format, ?string mode, ?string outputFields, ?bool outputGeometry, ?string outputInclude, ?int outputPrecision, ?float outputSimplify): RoutingIsochroneResponse
GET/api/v1/isochrone
Calculate an isochrone from a point
$client->routing->isochronePost(float lat, float lng, float time, ?string format, ?string mode, ?string outputFields, ?bool outputGeometry, ?string outputInclude, ?int outputPrecision, ?float outputSimplify): RoutingIsochronePostResponse
POST/api/v1/isochrone
Calculate a distance matrix between points
$client->routing->matrix(list<Destination> destinations, list<Origin> origins, ?string annotations, ?float fallbackSpeed, ?Mode mode): MatrixResult
POST/api/v1/matrix
ModelsExpand Collapse
list<Destination> destinations

Array of destination coordinates (max 50)

list<Origin> origins

Array of origin coordinates (max 50)

?string annotations

Comma-separated list of annotations to include: duration (always included), distance. Example: duration,distance.

?float fallbackSpeed

Fallback speed in km/h for pairs where no route exists. When set, unreachable pairs get estimated values instead of null.

?Mode mode

Travel mode (default: auto)

array<string,mixed>

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Properties properties

Snap result metadata

Type type
Destination destination

Geographic coordinate as a JSON object with lat and lng fields.

Origin origin

Geographic coordinate as a JSON object with lat and lng fields.

?int alternatives

Number of alternative routes to return (0-3, default 0). When > 0, response is a FeatureCollection of route Features.

?bool annotations

Include per-edge annotations (speed, duration) on the route (default: false)

?\Datetime departAt

Departure time for traffic-aware routing (ISO 8601)

?Ev ev

Electric vehicle parameters for EV-aware routing

?string exclude

Comma-separated road types to exclude (e.g. toll,motorway,ferry)

?Geometries geometries

Geometry encoding format. Default: geojson.

?Mode mode

Travel mode (default: auto)

?Overview overview

Level of geometry detail: full (all points), simplified (Douglas-Peucker), false (no geometry). Default: full.

?bool steps

Include turn-by-turn navigation steps (default: false)

?TrafficModel trafficModel

Traffic prediction model (only used when depart_at is set)

?list<Waypoint> waypoints

Intermediate waypoints to visit in order (maximum 25)

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Properties properties

Route metadata

Type type