Skip to content
GuidesBlogPlaygroundDashboard

Map Match

Match GPS coordinates to the road network
client.MapMatch.Match(ctx, body) (*MapMatchResult, error)
POST/api/v1/map-match
ModelsExpand Collapse
type MapMatchRequest struct{…}

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

Coordinates []MapMatchRequestCoordinate

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

Lat float64

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
Lng float64

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
Radiuses []float64optional

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

type MapMatchResult struct{…}

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 []MapMatchResultFeature

Snapped tracepoint Features in input order

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

Coordinates GeoJsonGeometryCoordinatesUnion

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

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

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

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties MapMatchResultFeaturesProperties
DistanceM float64optional

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

EdgeID int64optional

Road edge ID the point was snapped to

MatchingsIndex int64optional

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

Name stringoptional

Road name at the snapped point

Original []float64optional

Original GPS coordinate as [lng, lat]

WaypointIndex int64optional

Index of this tracepoint in the original coordinates array

Type MapMatchResultFeaturesType
Matchings []map[string, unknown]

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

Type MapMatchResultType