Currently I believe I’d have to subclass or create a modified version of the CarFlagEncoder to add truck speeds to Graphhopper; looking for an easier solution : )
good question ! We’ve decided to keep them closed source for now, as these are very specific needs although we see the generic application as e.g. the creation is relative powerful mechanism:
public static final TruckFlagEncoder createSmallTruck(String name) {
return new TruckFlagEncoder().setName(name).
setHeight(2.7).setWidth(2, 0.4).setLength(5.5).
setWeight(2080, 2080 + 1400).
init();
}
Of course, in the next months we’ll make creating such new profiles a lot easier without the need to understand or workaround the underlying OSM structure. See the related post: More flexibility in GraphHopper
Hi Peter - thanks for your reply. I see your point re: difficulty in interpreting OSM specifics; things can get quite ugly with all the different tag formats. Probably when / if I need a truck encoder I’ll just base it on the Car Flag encoder but enforce a maximum speed. I’m not convinced that the height / weight restrictions (e.g. low bridge etc) will be accurate enough in OSM data to justify that level of modelling anyway - at least for route optimisation. I look forward to the developments in making profiles easier - keep up the good work : )
Hy, are there some updates concerning truck flag encoder for the open source version? As you mentioned above you decided to keep them closed source for now (january 2016).
With the latest work: https://github.com/graphhopper/graphhopper/pull/1447 you can define several attributes per edge much easier and use them for a restriction. E.g. see this discussion where this pull request is further enhanced and provides simple configuration options via JSON or scripting: Flexible Vehicle Profiles