Skip to content
GuidesBlogPlaygroundDashboard

Map Match

Match GPS coordinates to the road network
map_match.match(**kwargs) -> MapMatchResult { features, matchings, type }
POST/api/v1/map-match
ModelsExpand Collapse
class MapMatchRequest { coordinates, radiuses }

GPS trace to snap to the road network. Provide an array of coordinate objects representing the GPS points. Maximum 50 points per request.

coordinates: Array[{ lat, lng}]

GPS coordinates to match, in order of travel (max 50 points)

lat: Float

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
lng: Float

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
radiuses: Array[Float]

Search radius per coordinate in meters. Must have the same length as coordinates or be omitted entirely. Default: 50m per point.

class MapMatchResult { features, matchings, type }

Map matching result as a GeoJSON FeatureCollection. Each Feature is a snapped tracepoint. The top-level matchings array contains the matched sub-routes connecting consecutive tracepoints.

features: Array[{ geometry, properties, type}]

Snapped tracepoint Features in input order

geometry: GeoJsonGeometry { coordinates, type }

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

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

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
Array[Float]

[longitude, latitude] or [longitude, latitude, elevation]

Array[Array[Float]]

Array of [lng, lat] positions

Array[Array[Array[Float]]]

Array of linear rings / line strings

Array[Array[Array[Array[Float]]]]

Array of polygons

type: :Point | :LineString | :Polygon | 3 more

Geometry type

One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
properties: { distance_m, edge_id, matchings_index, 3 more}
distance_m: Float

Distance from the original GPS point to the snapped point in meters

edge_id: Integer

Road edge ID the point was snapped to

matchings_index: Integer

Index into the matchings array indicating which matching sub-route this point belongs to

name: String

Road name at the snapped point

original: Array[Float]

Original GPS coordinate as [lng, lat]

waypoint_index: Integer

Index of this tracepoint in the original coordinates array

type: :Feature
matchings: Array[Hash[Symbol, untyped]]

Matched sub-routes. Each matching connects a contiguous sequence of tracepoints that could be matched to roads.

type: :FeatureCollection