Skip to content
GuidesPlaygroundDashboard

Match GPS coordinates to the road network

map_match.match(**kwargs) -> MapMatchResult { geometry, properties, type, legs }
POST/api/v1/map-match

Match GPS coordinates to the road network

ParametersExpand Collapse
trace: GeoJsonGeometry { coordinates, type }

GPS trace (GeoJSON LineString geometry)

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

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
radiuses: Array[Float]

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

ReturnsExpand Collapse
class MapMatchResult { geometry, properties, type, legs }

Map matching result with snapped geometry

geometry: GeoJsonGeometry { coordinates, type }
coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
Array[Float]
Array[Array[Float]]
Array[Array[Array[Float]]]
Array[Array[Array[Array[Float]]]]
type: :Point | :LineString | :Polygon | 3 more
One of the following:
:Point
:LineString
:Polygon
:MultiPoint
:MultiLineString
:MultiPolygon
properties: { confidence, distance, duration}
confidence: Float

Match confidence score

distance: Float

Total matched distance in meters

duration: Float

Estimated duration in seconds

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

Matched route legs between consecutive trace points

Match GPS coordinates to the road network

require "plaza"

plaza = Plaza::Client.new(
  api_key: "My API Key",
  environment: "local" # defaults to "production"
)

map_match_result = plaza.map_match.match(trace: {coordinates: [0], type: :Point})

puts(map_match_result)
Returns Examples