OpenRouteService not recognizing valid coordinates

Hi,

I’m able to get the correct location on the following two coordinates on Google Map, but openrouteservice don’t recognize it:

  • Lng, Lat
  • -101.50365, 32.21284
  • -101.50519, 32.20828

GET() call

curl --include \
     --header "Content-Type: application/json; charset=utf-8" \
     --header "Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8" \
  'https://api.openrouteservice.org/v2/directions/driving-car?api_key=<api_token>&start=-101.50365,32.21284&end=-101.50519,32.20828'

Response

"Could not find point 0: -101.5051900 32.2082800 within a radius of 350.0 meters.; Could not find point 1: -101.5036500 32.2128400 within a radius of 350.0 meters."

Hi @leungi,

ors searches by default only in a 350 m radius around the points. If there are no points on the used street network in that circle it won’t accept this point, hence the error.

You need to choose your points closer to the streets or use the radiuses parameter to increase the search radius.

Best regards

1 Like

Thanks for the prompt reply and clarification @amandus :pray:

Using POST() instead of GET() with the radiuses set to -1 (Inf) solves it :smile:

  curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car' \
  -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: <api_token>' \
  -d '{"coordinates":[[-101.50365,32.21284],[-101.50519,32.20828]],"radiuses":[-1,-1]}'