/** * This method applies the changes to the graph specified as feature collection. It does so by locking the routing * to avoid concurrent changes which could result in incorrect routing (like when done while a Dijkstra search) or * also while just reading one edge row (inconsistent edge properties). */ public ChangeGraphResponse changeGraph(Collection<JsonFeature> collection) { // TODO allow calling this method if called before CH preparation if (getCHFactoryDecorator().isEnabled()) throw new IllegalArgumentException("To use the changeGraph API you need to turn off CH"); Lock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { ChangeGraphHelper overlay = createChangeGraphHelper(ghStorage, locationIndex); long updateCount = overlay.applyChanges(encodingManager, collection); return new ChangeGraphResponse(updateCount); } finally { writeLock.unlock(); } }
hopper.getCHFactoryDecorator().setDisablingAllowed(true); hopper.getLMFactoryDecorator().setDisablingAllowed(true); hopper.importOrLoad(); if (hopper.getCHFactoryDecorator().isEnabled()) { isCH = true; Weighting weighting = hopper.getCHFactoryDecorator().getWeightings().get(0); CHGraph lg = g.getGraph(CHGraph.class, weighting); fillAllowedEdges(lg.getAllEdges(), allowedEdges);
throw new IllegalStateException("Although CH was enabled a non-CH algorithm factory was returned " + tmpAlgoFactory); tMode = getCHFactoryDecorator().getNodeBase(); queryGraph = new QueryGraph(ghStorage.getGraph(CHGraph.class, weighting)); queryGraph.lookup(qResults);
if (ch) { map.put(Parameters.Landmark.DISABLE, true); weighting = hopper.getCHFactoryDecorator().getWeightings().get(0); routingGraph = hopper.getGraphHopperStorage().getGraph(CHGraph.class, weighting);
if (hopper.getCHFactoryDecorator().isEnabled()) { final HintsMap chHints = new HintsMap(defaultHints).put(Parameters.CH.DISABLE, false); Weighting pickedWeighting = null; for (Weighting tmpWeighting : hopper.getCHFactoryDecorator().getWeightings()) { if (tmpWeighting.equals(weighting)) { pickedWeighting = tmpWeighting; throw new IllegalStateException("Didn't find weighting " + hints.getWeighting() + " in " + hopper.getCHFactoryDecorator().getWeightings());
/** * This method applies the changes to the graph specified as feature collection. It does so by locking the routing * to avoid concurrent changes which could result in incorrect routing (like when done while a Dijkstra search) or * also while just reading one edge row (inconsistent edge properties). */ public ChangeGraphResponse changeGraph(Collection<JsonFeature> collection) { // TODO allow calling this method if called before CH preparation if (getCHFactoryDecorator().isEnabled()) throw new IllegalArgumentException("To use the changeGraph API you need to turn off CH"); Lock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { ChangeGraphHelper overlay = createChangeGraphHelper(ghStorage, locationIndex); long updateCount = overlay.applyChanges(encodingManager, collection); return new ChangeGraphResponse(updateCount); } finally { writeLock.unlock(); } }
/** * This method applies the changes to the graph specified as feature collection. It does so by locking the routing * to avoid concurrent changes which could result in incorrect routing (like when done while a Dijkstra search) or * also while just reading one edge row (inconsistent edge properties). */ public ChangeGraphResponse changeGraph(Collection<JsonFeature> collection) { // TODO allow calling this method if called before CH preparation if (getCHFactoryDecorator().isEnabled()) throw new IllegalArgumentException("To use the changeGraph API you need to turn off CH"); Lock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { ChangeGraphHelper overlay = createChangeGraphHelper(ghStorage, locationIndex); long updateCount = overlay.applyChanges(encodingManager, collection); return new ChangeGraphResponse(updateCount); } finally { writeLock.unlock(); } }
graphHopper.getCHFactoryDecorator().setEnabled(false); graphHopper.getCHFactoryDecorator().setDisablingAllowed(true); graphHopper.importOrLoad();
graphHopperConfiguration.put("graph.location", "graph-cache"); GraphHopper hopper = new GraphHopperOSM().init(graphHopperConfiguration); hopper.getCHFactoryDecorator().setEnabled(false); System.out.println("loading graph from cache"); hopper.load(graphHopperConfiguration.get("graph.location", "graph-cache"));
@Override public void run(Bootstrap<?> bootstrap, Namespace args) { CmdArgs graphHopperConfiguration = new CmdArgs(); graphHopperConfiguration.put("graph.flag_encoders", args.getString("vehicle")); graphHopperConfiguration.put("datareader.file", args.getString("datasource")); graphHopperConfiguration.put("graph.location", "graph-cache"); GraphHopper hopper = new GraphHopperOSM().init(graphHopperConfiguration); hopper.getCHFactoryDecorator().setEnabled(false); hopper.importOrLoad(); }
hints.put(Parameters.CH.DISABLE, true); if (!graphHopper.getCHFactoryDecorator().isDisablingAllowed()) throw new IllegalArgumentException("Cannot disable CH. Not allowed on server side");
hints.put(Parameters.CH.DISABLE, true); if (!graphHopper.getCHFactoryDecorator().isDisablingAllowed()) throw new IllegalArgumentException("Cannot disable CH. Not allowed on server side");
args.put("prepare.min_one_way_network_size", 200); GraphHopper hopper = new GraphHopper().init(args); hopper.getCHFactoryDecorator().setEnabled(false); hopper.importOrLoad(); hopper.getCHFactoryDecorator().setEnabled(false); logger.info("loading graph from cache"); hopper.load("./graph-cache");
throw new IllegalStateException("Although CH was enabled a non-CH algorithm factory was returned " + tmpAlgoFactory); tMode = getCHFactoryDecorator().getNodeBase(); queryGraph = new QueryGraph(ghStorage.getGraph(CHGraph.class, weighting)); queryGraph.lookup(qResults);
throw new IllegalStateException("Although CH was enabled a non-CH algorithm factory was returned " + tmpAlgoFactory); tMode = getCHFactoryDecorator().getNodeBase(); queryGraph = new QueryGraph(ghStorage.getGraph(CHGraph.class, weighting)); queryGraph.lookup(qResults);
throw new IllegalStateException("Although CH was enabled a non-CH algorithm factory was returned " + tmpAlgoFactory); tMode = getCHFactoryDecorator().getNodeBase(); weighting = ((PrepareContractionHierarchies) tmpAlgoFactory).getWeighting(); routingGraph = ghStorage.getGraph(CHGraph.class, weighting);