Dynamic routing based on waytags

If you use the same software version, with the same config and same routing data it will on mobile.

So apparently when I changed footway to a different index in the highwayList in the DataFlagEncoder it works on both mobile and web. I’m not completely sure why this is the case, but the problem is solved! Thanks for your help!

What if I wanted to route on more than just highway tags, say surface tags? Is there a way to do that? Currently I’m getting the AllEdgesIterator from the GraphHopperStorage and and setting the distance of the edges to infinity, but it seems that the algorithm doesn’t look at distance when routing or otherwise this would work?

DataFlagEncoder dataFlagEncoder = (DataFlagEncoder) tmpHopp.getGraphHopperStorage().getEncodingManager().getEncoder("generic");
GraphHopperStorage graphHopperStorage = tmpHopp.getGraphHopperStorage();
AllEdgesIterator edges = graphHopperStorage.getAllEdges();
while (edges.next()) {
    String highway = dataFlagEncoder.getHighwayAsString(edges);
    String surface = dataFlagEncoder.getSurfaceAsString(edges);
    NodeAccess nodeAccess = tmpHopp.getGraphHopperStorage().getNodeAccess();
    double elevation1 = nodeAccess.getElevation(edges.getBaseNode());
    double elevation2 = nodeAccess.getElevation(edges.getAdjNode());
    if ((highway == "steps" && isCheckedSteps)
        || (surface == "gravel" && isCheckedUpaths)) {
            edges.setDistance(Double.POSITIVE_INFINITY);
            log("found steps");
    }
}

You’ll have to modify the GenericWeighting. Changing the distance is usually not appropriated. Change the weighting instead

This sounds strange. If you have a unit test where you can reproduce this problem, let us know.