Access denied...well, not in my country

Access denied? Not necessarily. Pedestrians are allowed to utilize cycleways in certain countries.

cycleway

Photo by Heidi Knisely

Valhalla already uses administrative information to determine if we drive on the right or left side of the street. We also use it to determine when we cross country borders and to set penalties and costs when forming international route paths. Additionally, we recently added support for country specific access restrictions.

Some countries allow you to walk on trunk roads but others don’t. While the default access restrictions apply to most countries, adding country-specific access restrictions can only enhance the routing graph and deliver more useful routing results.

Pedestrians permitted on cycleways

I know a lot of cyclists cringe at the thought of pedestrians on cycleways. However, in the Netherlands it is fine to walk on them — in fact, a Dutch user created an issue showing that we were avoiding cycleways. In the GIF below you can see the original pedestrian route avoiding cycleways, but in reality no one would have used this ridiculous route. Now that we are using the data from Netherlands access table to override the default access logic, you can see that a cleaner and more realistic pedestrian path is calculated utilizing cycleways.

animated pic

Pedestrians permitted not permitted on trunk roads

By default, pedestrians are permitted on trunk roads but in some countries this isn’t the case, and is often very dangerous. In the example shown below, the trunk road Gooiseweg has a speed limit of 70 km/hr which is not 100% safe for pedestrians. The updated and safer route takes residential roads and the Kelbergenpad cycleway, a safe and legal pedestrian route.

animated pic2

How did we make it happen

Mjolnir pulverizes data into a usable form. Well, not really, but it does give us the option to apply attribution to the Valhalla routing data. An administrative database is created via valhalla_build_admins and can then be used to determine country the for each edge during the building of the graph data. Using the tables on the country specific access restrictions page we generate a simple country-to-access array when access differs from the defaults. This data is then stored in the administrative database and accessed during the graph enhancement phase when building the route tiles. If an edge is located within a country with enhanced access, we will check to see if a user of the OpenStreetMap community set the access on this edge. If so, we will not override access with the country updates, otherwise, country-specific access wins.

What’s next for administrative information in Valhalla?

While updating the country specific access restrictions, we realized that we need to ingest the motorroad key and extend the access attribution a bit more. Moreover, we need to enhance the routing graph with country level speeds.

Of course, we would love to process access for more countries; however, there are only a handful of countries listed on the page. If your country is not listed, please add it and let us know and will get it added into Valhalla ASAP!

As always…check out the Mapzen Turn-by-Turn documentation and let us know if you have any questions.