You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
remove flagsDefault method. Was: DataFlagEncoder fails in flagsDefault #800
Turning on the generic encoder fails with "do not call flagsDefault":
java.lang.RuntimeException: do not call flagsDefault
at com.graphhopper.routing.util.DataFlagEncoder.flagsDefault(DataFlagEncoder.java:412)
at com.graphhopper.routing.util.EncodingManager.flagsDefault(EncodingManager.java:305)
at com.graphhopper.storage.BaseGraph.edge(BaseGraph.java:324)
at com.graphhopper.storage.GraphHopperStorage.edge(GraphHopperStorage.java:364)
at com.graphhopper.reader.dem.TunnelElevationInterpolatorTest.interpolatesElevationOfTunnelWithTwoOuterNodes(TunnelElevationInterpolatorTest.java:148)
Removing the flagsDefault method and relying on the super method does not work either:
java.lang.NullPointerException
at com.graphhopper.routing.util.AbstractFlagEncoder.flagsDefault(AbstractFlagEncoder.java:282)
at com.graphhopper.routing.util.EncodingManager.flagsDefault(EncodingManager.java:305)
at com.graphhopper.storage.BaseGraph.edge(BaseGraph.java:324)
at com.graphhopper.storage.GraphHopperStorage.edge(GraphHopperStorage.java:364)
at com.graphhopper.reader.dem.TunnelElevationInterpolatorTest.interpolatesElevationOfTunnelWithTwoOuterNodes(TunnelElevationInterpolatorTest.java:148)
Apparently, speedEncoder is null.
I'm currently working around this as follows:
@Override
public long flagsDefault(boolean forward, boolean backward) {
//// just pick car mode to set access values?
// throw new RuntimeException("do not call flagsDefault");
// TODO This is called on each of the encoders so I had to replace the
//// runtime exception with something,
// but I'm not sure this is correct.
return setAccess(0, forward, backward);
}
Yes, indeed. We should either avoid usage of this method entirely or init it properly e.g. with the carFwdMaxspeedEncoder ... please then we would also need to set a default value for the backward direction via carBwdMaxspeedEncoder. But again the real solution would be to get rid of that method, as this is only important for tests where we currently can create edges with just two nodes & distance, and then imply a default speed.
There is something very wrong with the subnetwork removal (removes nearly the full network for generic) and I have the feeling that this might cause it - thanks for catching it! Will investigate and probably provide a workaround until we fully migrate to a new interface.
Wasn't really related. Solved the issue via implementing a filter in acceptWay. So now OSM ways will be skipped before they got added to the graph, which avoids removing them afterwards (currently we are not that efficient if more than 40% of the nodes should be removed)
changed the title [-]DataFlagEncoder fails in flagsDefault[/-][+]remove flagsDefault method. Was: DataFlagEncoder fails in flagsDefault[/+]on Jul 4, 2017
Activity
karussell commentedon Sep 20, 2016
Yes, indeed. We should either avoid usage of this method entirely or init it properly e.g. with the
carFwdMaxspeedEncoder... please then we would also need to set a default value for the backward direction viacarBwdMaxspeedEncoder. But again the real solution would be to get rid of that method, as this is only important for tests where we currently can create edges with just two nodes & distance, and then imply a default speed.karussell commentedon Sep 20, 2016
There is something very wrong with the subnetwork removal (removes nearly the full network for
generic) and I have the feeling that this might cause it - thanks for catching it! Will investigate and probably provide a workaround until we fully migrate to a new interface.karussell commentedon Sep 23, 2016
Wasn't really related. Solved the issue via implementing a filter in acceptWay. So now OSM ways will be skipped before they got added to the graph, which avoids removing them afterwards (currently we are not that efficient if more than 40% of the nodes should be removed)
karussell commentedon Sep 23, 2016
This is also fixed now but I'll keep it open as 'improvement' as we should be able to get rid of the method somehow.
[-]DataFlagEncoder fails in flagsDefault[/-][+]remove flagsDefault method. Was: DataFlagEncoder fails in flagsDefault[/+]