0

How can i add a bridge as a normal street in the config of osm2po 5.1.0?

When i try to calculate the route from "333842" to "291763" using austria-latest.osm.pbf an error occurs about failing to calculate the route. After analyzing the route i found that there is a bridge within this route.

I tried to add this in the config file using

wtr.tag.highway.bridge       =   1,  26, 50,  car|foot

unfortunately without success. Any ideas how to solve this?

1

bridge is a property and no highway-type in OSM. So let's assume it has been tagged along a secondary street. There are two approaches in osm2po:

  1. Give it an own road clazz, but then you'll lose the highway type.
  2. Leave it as is, and mark its existence in the flags

For both variants it is recommended to extend the flaglist:

wtr.flagList = car, bike, foot, rail, ferry, poly, bridge

For the first approach you'll need something like this:

wtr.tag.bridge = 1, 66, 50, bridge
wtr.tag.highway.secondary = 2,  21, 60, car
...
wtr.allow.highway.secondary = car
wtr.finalMask = car

Pay attention to the secondary street's priority of 2 (first param). This means, that if both are tagged, the bridge will win and you'll receive a clazz of 66.

Nevertheless, the second approach is recommended:

Just add wtr.allow.bridge = bridge which does not change the clazz. Instead you'll find the hint in the table-column flags. The flags are Int32-Bits, thus a combination of car|bridge is a simple IntValue, resulting from 1 + 64 = 65

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.