I am using Osm2Po to find routes between two points.
I am trying to find routes based on the difficulty specified by the user.
Basically, I would like to calculate the cost based on some parameter in the way. For now this parameter could be the type of road e.g. if its a primary road the cost would increase. If it was a secondary road it the cost would decrease especially. Any road with a cyclelane would have the best cost.
I have been looking into overriding the DefaultRouter methods: traverse, findpath and calcEdgeCost.
I was thinking that I could get the clazz type from the edge being currently examined and set its cost using calcEdgeCost.
One problem is that for some reason calling getVertexClazzes returns nothing but zeroes. getEdgeFlags returns null.
Here is part of my osm2po.config which might be relevant
#wayTagResolver.class = com.to.another.package.YourWayTagResolver
#nodeTagResolver.class = com.to.another.package.YourNodeTagResolver
#relationTagResolver.class = com.to.another.package.YourRelationTagResolver
# Properties of the DefaultWayTagResolver use this prefix.
wayTagResolver.prefix = wtr
# Custom flags with ascending binary values 1, 2, 4, 8 ...
# You may define up to 32 Flags (Bits).
wtr.flagList = car, bike, foot, rail, ferry
# final decision; only allow ways with these flags
wtr.finalMask = bike
# very special hint for level_crossing modification
wtr.shuttleTrainMask = rail|car
# Main-Tag definitions. Params 1-4:
# 1) concurrent order
# 2) class (1-127)
# 3) default speed in kmh
# 4) allowed transportation type (optional) - since v4.5.30
wtr.tag.highway.motorway = 1, 11, 120, car
wtr.tag.highway.motorway_link = 1, 12, 30, car
wtr.tag.highway.trunk = 1, 13, 90, car
wtr.tag.highway.trunk_link = 1, 14, 30, car
wtr.tag.highway.primary = 1, 15, 15, car|bike
wtr.tag.highway.primary_link = 1, 16, 30, car
wtr.tag.highway.secondary = 1, 21, 15, car|bike
wtr.tag.highway.secondary_link = 1, 22, 15, car|bike
wtr.tag.highway.tertiary = 1, 31, 12, car|bike
wtr.tag.highway.residential = 1, 32, 12, car|bike
wtr.tag.highway.road = 1, 41, 14, car|bike
wtr.tag.highway.unclassified = 1, 42, 12, car|bike
wtr.tag.highway.service = 1, 51, 5, car|bike
wtr.tag.highway.living_street = 1, 63, 7, car|bike|foot
wtr.tag.highway.pedestrian = 1, 62, 5, bike|foot
wtr.tag.highway.track = 1, 71, 10, bike|foot
wtr.tag.highway.path = 1, 72, 10, bike|foot
wtr.tag.highway.cycleway = 1, 81, 15, bike
#wtr.tag.highway.footway = 1, 91, 5, foot
#wtr.tag.highway.steps = 1, 92, 5, foot
wtr.tag.route.ferry = 2, 01, 10, ferry
wtr.tag.route.shuttle_train = 2, 02, 50, rail|car
wtr.tag.railway.rail = 3, 03, 50, rail