Skip to content
GuidesPlaygroundDashboard

Match GPS coordinates to the road network

map_match.match(MapMatchMatchParams**kwargs) -> MapMatchResult
POST/api/v1/map-match

Match GPS coordinates to the road network

ParametersExpand Collapse

GPS trace (GeoJSON LineString 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"
radiuses: Optional[Iterable[float]]

Search radius per coordinate in meters (optional, default 50)

ReturnsExpand Collapse
class MapMatchResult:

Map matching result with snapped geometry

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
confidence: Optional[float]

Match confidence score

distance: Optional[float]

Total matched distance in meters

duration: Optional[float]

Estimated duration in seconds

type: Literal["Feature"]
legs: Optional[List[Dict[str, object]]]

Matched route legs between consecutive trace points

Match GPS coordinates to the road network

import os
from plaza import Plaza

client = Plaza(
    api_key=os.environ.get("PLAZA_API_KEY"),  # This is the default and can be omitted
)
map_match_result = client.map_match.match(
    trace={
        "coordinates": [0],
        "type": "Point",
    },
)
print(map_match_result.geometry)
Returns Examples