Are path details about bike infrastructure available?

Hi!
I am currently working on a simple mode choice model for a german City.
So I am creating a resistance matrix between locations containing the travel time and distance between all locations for car and public transport (both from the Google distance matrix API) and bicycle (from the Graphhopper Matrix API).

As the choice whether to take a bike for a trip not only depends on the trip length, but also on the bicycle infrastructure, I would need some kind of variable which tells me, how nice it is to cycle on the respective bike routes. The path details I found do not really help me. Is it somehow possible to retrieve tags such as bicycle=*? Or alternatively can I see the OSM IDs of the path nodes, so that I can directly check in OSM?

Thanks for your support!

The path details of the Routing API returns the “bike_priority” path details, this value probably bests represents what you are searching for. But what I read about the proprietary Matrix API these details are not exposed there.

Hi thanks!
So the best would be to write a loop in which I send a routing query for each relation individually?

I will try that!

Hi @ratrun, thanks a lot for your advise! I changed my code, retrieved the “bike_priority” path details, and calculated a weighted average for each relation. So far I am happy, but I still don’t quite understand what the value actually means. Sure, it says how nice it is to cycle along an edge, however how is it calculated? And what OSM and other data is used for the calculation? I found a lot about costumization, but nothing about the default…

There is no documentation for how the bike_priority is calculated. You need to look it up the source code. Here are the relevant two Java source files:

  1. Common bike priority parser: This code is common for the ordinary bike, mountain bike and the race bike profile.

  2. Touring bike specific priority parser: This code is the touring bike (in short bike ) specific implementation.

Even if you might not be familiar with the Java language it should be possible to get an idea about what OSM tags are used for the calculation of the priority. Please note that we are using OSM tags only, so no other data is evaluated.