Match GPS coordinates to the road network
mapMatch().match(MapMatchMatchParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : MapMatchResult
POST/api/v1/map-match
Match GPS coordinates to the road network
package com.plazafyi.example
import com.plazafyi.client.PlazaClient
import com.plazafyi.client.okhttp.PlazaOkHttpClient
import com.plazafyi.models.mapmatch.MapMatchMatchParams
import com.plazafyi.models.mapmatch.MapMatchRequest
import com.plazafyi.models.mapmatch.MapMatchResult
fun main() {
val client: PlazaClient = PlazaOkHttpClient.fromEnv()
val params: MapMatchRequest = MapMatchRequest.builder()
.coordinates(listOf(
MapMatchRequest.Coordinate.builder()
.lat(48.8566)
.lng(2.3522)
.build(),
MapMatchRequest.Coordinate.builder()
.lat(48.857)
.lng(2.353)
.build(),
MapMatchRequest.Coordinate.builder()
.lat(48.8575)
.lng(2.354)
.build(),
))
.build()
val mapMatchResult: MapMatchResult = client.mapMatch().match(params)
}{
"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"
}