0

I'm calling the Mapbox Directions API from a mobile app and manually drawing the resulting path on a map. If I pass in 2 relatively close locations, the response includes coordinates and the path nicely follows roads. If I pass in 2 locations that are far away, the the response includes more coordinates, but the path follows straight lines over long distances, ignoring roads. Seems like it loses details with longer distances.

Does Mapbox Directions API limit the number or precision of coordinates in a response and if so, how can I tell?

For instance Query 1 returns 8 coordiantes representing a about 1/4 mile following roads. Query 2 returns about 60 coordinates, but the path has long segments that go over roads.

You can visualize this using the API Playground, putting in -73.989,40.733;-74,40.733 for Query 1 and -73.989,40.733;-94,40.733 for Query 2

Query 1 https://api.mapbox.com/directions/v5/mapbox/driving/-73.989%2C40.733%3B-74%2C40.733.json?access_token=pk.eyJ1Ijoic3RldmVyZXMiLCJhIjoiY2syM2pzZmFwMjV3cTNkbXV2Nnpwd2I4aiJ9.q-86qHLcFYbwk_RLs27N-Q&geometries=geojson

Query 2 https://api.mapbox.com/directions/v5/mapbox/driving/-73.989%2C40.733%3B-94%2C40.733.json?access_token=pk.eyJ1Ijoic3RldmVyZXMiLCJhIjoiY2syM2pzZmFwMjV3cTNkbXV2Nnpwd2I4aiJ9.q-86qHLcFYbwk_RLs27N-Q&geometries=geojson

Thanks!

Tobrun
  • 18,291
  • 10
  • 66
  • 81
steveres
  • 21
  • 3