0

I am trying to query some public transport data from the here API. However, I am struggeling with when the origin point is far away from a station. In the API reference there is the pedestrian[distance] paramter. I, however, simply cant make it work.

enter image description here

This query for example:

https://transit.router.hereapi.com/v8/routes?apiKey=<API_KEY>origin=48.3787,16.5122&destination=48.211029313540855,16.347822689187193&modes=cityTrain&departureTime=2021-10-26T08:08:00&pedestrian[100000]

Return this:

enter image description here

Is there any way I can alway make sure to get a result. Even when the next station is e.g. 20 km far away?

Lenn
  • 1,283
  • 7
  • 20

1 Answers1

0

This is because your URL is not correctly formed, please try to use this one instead: https://transit.router.hereapi.com/v8/routes?apiKey={APIKEY}&origin=48.3787,16.5122&destination=48.211029313540855,16.347822689187193&modes=cityTrain&departureTime=2021-10-26T08:08:00&pedestrian[maxDistance]=6000

  • thank you very much!:) You know what is the max distance value I can provide? And is there any nice workaround if there is no station near? – Lenn Oct 18 '21 at 13:07
  • The maximum walking distance will be 6km, if there is no stations within 6km then there won't be a valid route. –  Nov 01 '21 at 07:19