I am using mapbox to display maps in my application. I am displaying user's location as the user moves and to keep the location on the street I am trying to use map box map-matching api. But the api works with the test points in map-matching api, but throws error when i use my actual lat-long points. https://www.mapbox.com/api-documentation/#retrieve-a-match I send the request using
curl -X POST \
--header "Content-Type:application/json"-d @trace.json \
"https://api.mapbox.com/matching/v4/mapbox.driving.json?access_token=<your token here>"
When my trace.json file has the test input mentions in api, i get the result This is trace.json with lat long from the api, and returns result.
{
"type": "Feature",
"properties": {
"coordTimes": [
"2015-04-21T06:00:00Z",
"2015-04-21T06:00:05Z"
]
},
"geometry": {
"type": "LineString",
"coordinates": [
[ 13.418946862220764, 52.50055852688439 ],
[ 13.419011235237122, 52.50113000479732 ]
]
}
}
But the same trace.json with my lat-long point throws following error.
Error : {"message":"each coordinate must be array with float in-bounds [longitude, latitude]","code":"InvalidInput"}
{
"type": "Feature",
"properties": {
"coordTimes": [
"2015-04-21T06:00:00Z",
"2015-04-21T06:00:05Z"
]
},
"geometry": {
"type": "LineString",
"coordinates": [
[47.586479, -122.229704],
[47.578238, -122.209869]
]
}
}
can't figure out what's wrong with the request.