4

I have created a PostGIS DB using osm2po and I am using pgrouting to calculate the routes.

The application I am creating should find routes for cyclists so I want the route finder to prefer roads with cycle lanes present and to never plot a route containing motorways.

Looking through the config files I see: wrt.finalMask = car along with other tags such wtr.tag.highway.motorway = 1, 11, 120, car

I was wondering are these the parameters that I should tweak to accomplish this?

Would I just remove tags such as motorway etc.?

Thanks

2

1 Answer 1

2

It's easy. Let's regard these lines:

wtr.tag.highway.secondary_link = 1, 22, 30,  car
wtr.tag.highway.tertiary = 1, 31, 40,  car|bike

Setting

wtr.finalMask = car

imports both road types,

setting

wtr.finalMask = bike

imports the tertiary road only.

Actually car|bike are values (1+2=3) in the flags-column. It's derived from the wtr.flagList = car, bike, foot ... where car=1, bike=2, foot=4 and so on.

2
  • Hi, Thanks a lot that works well. Just one question. Would it be possible for me to add a custom tag such as 'difficulty' to the OSM data in my database and then have osm2po calculate the costs based on the difficulty of a way from 0 to 10. This is so the route-finder would prefer easier roads than difficult roads?
    – sam
    Commented Feb 1, 2013 at 11:51
  • Hi Sam, please move your question to another (new) thread. But in short: yes, it's possible.
    – Carsten
    Commented Feb 1, 2013 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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