Match GPS coordinates to the road network
$client->mapMatch->match(list<Coordinate> coordinates, ?list<float> radiuses): MapMatchResult
POST/api/v1/map-match
Match GPS coordinates to the road network
Match GPS coordinates to the road network
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
$client = new Client(apiKey: 'My API Key', environment: 'local');
$mapMatchResult = $client->mapMatch->match(
coordinates: [
['lat' => 48.8566, 'lng' => 2.3522],
['lat' => 48.857, 'lng' => 2.353],
['lat' => 48.8575, 'lng' => 2.354],
],
radiuses: [0],
);
var_dump($mapMatchResult);{
"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"
}