GIScience / openrouteservice

🌍 The open source route planner api with plenty of features.
https://openrouteservice.org
GNU General Public License v3.0
1.43k stars 393 forks source link

no error message for exceeding maximum distance limit for matrix request #666

Open TahiraU opened 4 years ago

TahiraU commented 4 years ago

Here's what I did

Request a /v2 route for matrix (profile foot walking)

  curl -X POST \
  'https://api.openrouteservice.org/v2/matrix/foot-walking' \
  -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: 5b3ce3597851110001cf624829097f59081b42ceb3d4041e29358b5b' \
  -d '{"locations":[[9.70093,48.477473],[9.207916,49.153868],[37.573242,55.801281],[115.663757,38.106467]]}'

Here's what I got

{"durations":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],...


Here's what I think could be improved

An error message if maximum distance limit for matrix request is exceeded

MichaelsJP commented 4 years ago

Wheelchair throws an OutofBounds error on these coordinates. The reason is, that wheelchair is only available for Germany or Europe and the OutOfBounds check checks for the bounds of the entire profile graph and not only how far the coordinates are away or if the results are wrong:

MatrixSearchContext

So in exchange the OutOfBounds is not thrown for the foot profile because the coordinates are theoretical still inside the graph bounds (world). I'll check how we could catch and return the obviously wrong results like in the issue example properly.