Public transport to an airport lat/lng ("far" from roads)

Hello!

I got an annoying case recently: I tried to calculate the route from an address in Belgium to the “Brussels Airport” with that URL

http://xxxxxxxxxxxx:8942/route?point=50.77803572246812,4.7524564122593755&point=50.90140152,4.48443985&type=json&locale=en&elevation=false&profile=pt&pt.earliest_departure_time=2020-01-01T07%3A00%3A00.000Z&points_encoded=false

which returned

{“hints”:{“visited_nodes.sum”:19,“visited_nodes.average”:19},“info”:{“copyrights”:[“GraphHopper”,“OpenStreetMap contributors”],“took”:0},“paths”:[]}

I guessed it’s because the lat/lng (50.90140152,4.48443985) for Brussels Aiport is in the middle of the airport area, a little bit far from roads…

So I checked the same request with 50.894573125631915,4.482055251769979 this time (corresponding to a road at the entrance of the airport) and this time I have a good result!

But I can’t change the Airport location in our system, we have other places like that… Is there any way to solve this situation? Like finding the closest road automatically?

Thanks!

Hiya, unsure if this will help with public transport, but take a look here;

Hi Greg,

Thanks for your quick response!

Unluckily, we host GraphHopper “by default” and just call the routing API so it would need to be fixed by an option given in the URL :slight_smile:

Sorry, haven’t implemented via url before.
In your configuration can you set;

#In many cases the road network consists of independent components without any routes going in between. In
# the most simple case you can imagine an island without a bridge or ferry connection. The following parameter
# allows setting a minimum size (number of edges) for such detached components. This can be used to reduce the number
# of cases where a connection between locations might not be found.
  prepare.min_network_size: 200

Play around with that value as it seems to imply that it might help.
I’m unsure if you will have to recreate your graph, also it will impact all requests

Good idea, I will try!

Hi!

I generated a new graph with 600 then 6000 and also 60,000 for this value but same behavior: just no way to calculate the distance to the airport if we use a latitude/longitude far away from the roads :frowning: (no error like “connection between locations not found” ==> just no path found).

If nobody else has an idea, I guess I will modify our airports list to locate them at their entrance!

I would keep min_network_size at the default value as changing it could either negatively influence performance of the lookup or size of the location index. Instead you can try to double index.max_region_search from 4 to 8 or even 16. But this won’t fix the underlying issue that a point snaps too far away from the road network (usually never desired - and this is the reason for the default values) and you need to find the reason of that (often barriers or private roads)

Powered by Discourse