Repository navigation
Closed
Labels
Milestone
Description
Currently only one profile can be CH-prepared and therefor faster. For this change eveything is in place via #111 and #339 both implemented in PR #447.
- access bits won't be necessarily on the first&second bit of the encoder.flags now anymore. But for shortcut weights we need them there.
- how to get these routing graphs - via
getGraph(Graph.class, new Weighting, new FlagEncoder)? - do multiple CH-preparations based on different weightings/flagencoders
- we need a separate per-request parameter to force none-CH requests like
flexibility=true. This possibility should be disabled by default like jsonp is disabled for request stability reasons. - how to handle multiple routing factories for ch and none-ch in GraphHopper class
- make config possible in Java API and in config.properties
- remove TODOs and remove warning in config.properties regarding multiple profiles with enabled CH
Once we have this we need #86 and the bug mentioned in #318 which will get a lot more urgent.
Usage
Via config.properties:
- Specify multiple profiles e.g.
graph.flagEncoders=car,bike - Use
prepare.chWeighting=fastest(currently the default)
Or via Java API:
hopper.setCHEnable(true); // currently the default
hopper.setCHWeighting("fastest"); // currently the default
hopper.setEncodingManager(carFlagEncoder, bikeFlagEncoder);
Then do a normal import and you should see two CH preparations going on:
2015-07-27 14:49:29,472 [main] INFO com.graphhopper.GraphHopper - 1/2 calling prepare.doWork for FASTEST|car ... (totalMB:955, usedMB:283)
2015-07-27 14:49:30,879 [main] INFO com.graphhopper.routing.ch.PrepareContractionHierarchies - 0, updates:0, nodes: 158 254, shortcuts:0, dijkstras:354 316, t(dijk):0.6, t(period):0.0, t(lazy):0.0, t(neighbor):0.0, meanDegree:1, algo:2MB, totalMB:955, usedMB:293
...
2015-07-27 14:49:52,309 [main] INFO com.graphhopper.routing.ch.PrepareContractionHierarchies - took:22, new shortcuts: 99799, PREPARE+FASTEST|car, car, dijkstras:2272753, t(dijk):15.8, t(period):6.71, t(lazy):3.58, t(neighbor):6.39, meanDegree:0, initSize:158254, periodic:20, lazy:10, neighbor:20, totalMB:957, usedMB:85
2015-07-27 14:49:52,309 [main] INFO com.graphhopper.GraphHopper - 2/2 calling prepare.doWork for FASTEST|bike ... (totalMB:957, usedMB:85)
2015-07-27 14:49:55,216 [main] INFO com.graphhopper.routing.ch.PrepareContractionHierarchies - 0, updates:0, nodes: 158 254, shortcuts:0, dijkstras:819 501, t(dijk):1.36, t(period):0.0, t(lazy):0.0, t(neighbor):0.0, meanDegree:1, algo:2MB, totalMB:957, usedMB:95
...
2015-07-27 14:50:49,523 [main] INFO com.graphhopper.routing.ch.PrepareContractionHierarchies - took:57, new shortcuts: 183998, PREPARE+FASTEST|bike, bike, dijkstras:4726956, t(dijk):46.95, t(period):24.06, t(lazy):5.42, t(neighbor):14.02, meanDegree:1, initSize:158254, periodic:20, lazy:10, neighbor:20, totalMB:957, usedMB:172
Activity
karussell commentedon Jul 24, 2015
This is now compiling, all tests running through and working for one profile at least. More profiles cause routing problems
Connection between locations not foundfor the additional profiles even for short distances and if it is routing causing strange artifacts. To be investigated.refactoring necessary for #464
first measurement runnable, all tests pass, for multiple CH profiles #…
karussell commentedon Jul 24, 2015
See branch https://github.com/graphhopper/graphhopper/tree/issue_464
Looks that some integration tests are not passing, will investigate next week.
minor bug fix, added unit tests, fixed integration tests, #464
karussell commentedon Jul 27, 2015
It is working now! Please test and report problems!
I added a usage description in the top comment entry. This leads to huge RAM savings for multiple profiles and also import time savings as the import has to be done only once. Furthermore to an easier setup.
Example 3 profiles (car, bike2, foot):
50g RAM used for import, imported in 22h, resulting storage is 34g ~= RAM used for running
vs. old behaviour:
42g RAM used for import, imported in 26h, resulting storage is 57g ~= RAM used for running
I.e. an additional CH profile is 5g to 8g large.
karussell commentedon Jul 27, 2015
further improvements to be done:
fixing some minor TODOs, #464
karussell commentedon Aug 4, 2015
All problems fixed. Or at least an issue created (#490, #491, #492)
merged branch issue #464
karussell commentedon Aug 4, 2015
Merged
devemux86 commentedon Aug 4, 2015
👍