Match GPS coordinates to the road network
client.mapMatch.match(MapMatchMatchParams { coordinates, radiuses } body, RequestOptionsoptions?): MapMatchResult { features, matchings, type }
POST/api/v1/map-match
Match GPS coordinates to the road network
import Plaza from '@plazafyi/sdk';
const client = new Plaza({
apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted
});
const mapMatchResult = await client.mapMatch.match({
coordinates: [
{ lat: 48.8566, lng: 2.3522 },
{ lat: 48.857, lng: 2.353 },
{ lat: 48.8575, lng: 2.354 },
],
});
console.log(mapMatchResult.features);{
"features": [
{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"distance_m": 0,
"edge_id": 0,
"matchings_index": 0,
"name": "name",
"original": [
0,
0
],
"waypoint_index": 0
},
"type": "Feature"
}
],
"matchings": [
{
"foo": "bar"
}
],
"type": "FeatureCollection"
}Returns Examples
{
"features": [
{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"distance_m": 0,
"edge_id": 0,
"matchings_index": 0,
"name": "name",
"original": [
0,
0
],
"waypoint_index": 0
},
"type": "Feature"
}
],
"matchings": [
{
"foo": "bar"
}
],
"type": "FeatureCollection"
}