Could not find point 1: -83.5161180 10.5628820 within a radius of 350.0 meters

While using the Directions API I seem to have encountered a 404 error with the following message.
“Could not find point 1: -83.5161180 10.5628820 within a radius of 350.0 meters.”

Curl Code to reproduce:

curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car/geojson' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: REMOVED_API_KEY_FOR_SECURITY' \
  -d '{"coordinates":[[-84.06769,9.931558],[-83.516118,10.562882]]}'

I played around with the radiuses field values adding the max value (-1) for the coordinate which could not be found but I got a the same error.
“Could not find point 1: -83.5161180 10.5628820 within a radius of -1.0 meters.”

Can someone look into it and get back to me please? This has happened on at least 2 other instances while finding directions in Costa Rica.

curl -X POST
https://api.openrouteservice.org/v2/directions/driving-car/geojson
-H ‘Content-Type: application/json; charset=utf-8’
-H ‘Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8’
-H ‘Authorization: 5b3ce3597851110001cf6248f7cfa63b5d3447a480de601655664b39’
-d ‘{“coordinates”:[[-84.06769,9.931558],[-83.516118,10.562882]],“radiuses”:[10000,-1]}’

There is no road at that coordinate in Costa Rica. Only a foot path. The next road seems to be about 2km away. What do you expect to find?

Thanks for your response.

I am working on a simple routing tool to indicate a general route for our customers. 100% route calculation from one point to the other would be great but an approximate route also works.

Since the radius parameter is set to an appropriate value I expect the system to replace the point not found with the closest point the system can route to.

Upon manually modifying the query to set the second coordinate to the the closest road the system delivers a correct routing response (without the need for the radiuses parameter). This confirms my suspicion and the radiuses parameter does not seem to be working as expected.

  curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car/geojson' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: 5b3ce3597851110001cf6248f7cfa63b5d3447a480de601655664b39' \
  -d '{"coordinates":[[-84.587463,10.373281],[-83.513024,10.539532]]}'

Okay, I will have another look at it. Does it help if you set the radius to a high value like 5000, instead of -1?

No. I tried values 10000 and 100000 and got the same response.
“Could not find point 1: -83.5161180 10.5628820 within a radius of 10000.0 meters.”

Setting the radius to an arbitrary high value won’t help because there is an internal limit to this value. This limit is not really documented because of some implementation details it doesn’t have a fixed value but rather varies depending on coordiantes. Setting the radius to -1 uses the maximum available value of the radius, so I’m afraid that if you still get an error with this value there is not much that could be done other than setting up your own ORS instance. Then you could increase the location index parameters responsible for matching the locations to accommodate your needs. For more details see #713 and the references therein.