Low-Level Api not working

The reason that you don’t find a path is that there is a new footway in between the from coordinate and the next road that was only added after 220101:

hopper.getLocationIndex().findClosest(52.5301592,13.388860, EdgeFilter.ALL_EDGES); will return the next possible snap that is closest to the given coordinate (the green marker). But since this is a footway and you are using a car profile this road is inaccessible and so the routing algorithm does not find a path. So you need to use an edge filter that skips the footway and snaps to Borsigstraße instead:

  DefaultSnapFilter snapFilter = new DefaultSnapFilter(weighting, em.getBooleanEncodedValue(Subnetwork.key("car")));
        Snap fromSnap = hopper.getLocationIndex().findClosest(52.5301592,13.388860, snapFilter);
        Snap toSnap = hopper.getLocationIndex().findClosest(52.530259,13.352512, snapFilter);

The DefaultSnapFilter will make sure to not snap to a road that is inaccessible for the given weighting and also ignore subnetworks, which can also lead to paths that aren’t found.

1 Like