LeticiaB
(Leticia B)
February 8, 2023, 9:20am
#1
I started to develop a aplication mobile in flutter to get velocity of highways with API snap to road, but the response of API empty.
Detail: this test is in brazil. I don’t know if it makes a difference.
points: -23.013614,-49.776269;-22.884825, -49.957712
response
{
“route”: [],
“projectedPoints”: [
{
“type”: “Feature”,
“geometry”: null,
“properties”: {
“routeIndex”: null
}
},
{
“type”: “Feature”,
“geometry”: null,
“properties”: {
“routeIndex”: null
}
}
]
}
thanks by any help!!
maloleps
(Przemek Malolepszy)
February 10, 2023, 2:45pm
#2
this service accepts coordinates in lon,lat format.
also from docs:
The maximum road distance between two consecutive points cannot exceed 6000 meters
LeticiaB
(Leticia B)
February 10, 2023, 5:31pm
#3
I understood, but I’ve tried with coordinates less than 6 km and the response is still an empty route
points : -23.066880, -49.617922; -23.070735, -49.599781
url : https://api.tomtom.com/snapToRoads/1?key={{API_KEY} }&points=-23.066880, -49.617922; -23.070735, -49.599781&headings=0;0×tamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={route{properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto
Thanks for any help!
maloleps
(Przemek Malolepszy)
February 10, 2023, 6:19pm
#4
those points are in the middle of Atlantic Ocean.
You need to swap longitude with latitude.
LeticiaB
(Leticia B)
February 10, 2023, 6:51pm
#5
LeticiaB:
-23.066880, -49.617922
I don’t understand why the points are in the middle of the ocean. They were directly copied from Google Maps, I changed the longitude to latitude but I still get the empty route
https://api.tomtom.com/snapToRoads/1?key={{API_KEY} }&points=-49.61760270487343, -23.06698208551979;-49.58472955385686,-23.07420749124332&headings=0;0×tamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={route{properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto
maloleps
(Przemek Malolepszy)
February 10, 2023, 9:31pm
#6
Fixed request:
https://api.tomtom.com/snapToRoads/1?key={{API_KEY}}&points=-49.61760270487343,-23.06698208551979;-49.58472955385686,-23.07420749124332&fields={route{geometry{coordinates},properties{id,speedLimits{value,unit,type}}}}
Now the speed limit can be attached to a geometry.