0

We would like to improve our bike routing to also incorporate, for example, the information on the surface of the used streets. I don't quiet get how I should use the Osm2Po plugin in mechanism. I've set up my project in Eclipse and have a working development environment with a custom WayTagResolver (not sure if that is really needed) and a custom PostProcessor that in theory should write the additional information in the SQL file.

Is there a tutorial anywhere that can help me?

1 Answer 1

1

osm2po transforms tags to a simple and flat representation which in most use cases is sufficient. Three attributes exist for this purpose. The clazz(byte 1-27) denotes the anchor/main-type. This is mostly set by highway tags. The second one are the flags (Integer32). Each parsed tag can indicate its existence in one Bit (flag). These bits must be declared in the wtr.flagList before. e.g.:

wtr.flagList = car, bike, foot, ..., surfaceA, surfaceB

Where car=1, bike=2, foot=4, ..., surfaceA=32(?), surfaceB=64

e.g. bike|surfaceB=66

Once declared, you can define simple rules:

wtr.allow.tracktype.grade[1|2] = bike|surfaceA
wtr.allow.tracktype.grade[3|4] = bike|surfaceB
wtr.allow.tracktype.grade[5]   = bike|surfaceA|surfaceB

where allow=SetBitFlag and deny=RemoveBitFlag

Theses flags will be written to the pgRouting-Table respectively. The third attribute is meta but it cannot be influenced thru configuration.

So, only if things become more complex, it is necessary to overwrite the API.

2
  • ah okay, thank you @carsten for your quick reply. i will give it a try and report here. on a quick other note, is there a config parameter for the osm2po main class to specify a config file location. it's pretty difficult to edit the version inside the jar file. Commented Jan 30, 2015 at 10:02
  • Either modify the osm2po.config (hopefully not that one inside the jar) or overwrite parameters on the commandline. For more complex deviations you can indeed use a parameter to point to another config. config=path/to/special.config You can also hold different configs in one by using wayTogResolver.prefix
    – Carsten
    Commented Jan 30, 2015 at 10:17

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.