public static GHDirectory createGHDirectory(String graphHopperFolder) { return new GHDirectory(graphHopperFolder, DAType.RAM_STORE); }
protected Directory getDirectory() { if (dir != null) return dir; logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType + " using calcmean: " + calcMean); return dir = new GHDirectory(cacheDir.getAbsolutePath(), daType); }
public AbstractNodeContractor(CHGraph prepareGraph, Weighting weighting) { this.prepareGraph = prepareGraph; this.encoder = weighting.getFlagEncoder(); originalEdges = new GHDirectory("", DAType.RAM_INT).find(""); originalEdges.create(1000); }
@Before public void setUp() { dir = new GHDirectory("", DAType.RAM_INT); }
private GraphHopperStorage createStorageWithWeightings(Weighting... weightings) { return new GraphHopperStorage(Arrays.asList(weightings), new GHDirectory(defaultGraphLoc, DAType.RAM_STORE), encodingManager, false, new GraphExtension.NoOpExtension()); } }
dataAccessType = DAType.MMAP_RO; GHDirectory dir = new GHDirectory(ghLocation, dataAccessType); GraphExtension ext = encodingManager.needsTurnCostsSupport() ? new TurnCostExtension() : new GraphExtension.NoOpExtension();
@Test(expected = IllegalStateException.class) public void testLoadingWithWrongWeighting_throws() { // we start with one weighting GraphHopperStorage ghStorage = newGHStorage(new GHDirectory(defaultGraphLoc, DAType.RAM_STORE), false); ghStorage.create(defaultSize); ghStorage.flush(); // but then configure another weighting and try to load the graph from disk -> error GraphHopperStorage newGHStorage = createStorageWithWeightings(new ShortestWeighting(carEncoder)); newGHStorage.loadExisting(); }
@Test(expected = IllegalStateException.class) public void testLoadingWithExtraWeighting_throws() { // we start with one weighting GraphHopperStorage ghStorage = newGHStorage(new GHDirectory(defaultGraphLoc, DAType.RAM_STORE), false); ghStorage.create(defaultSize); ghStorage.flush(); // but then add an additional weighting and try to load the graph from disk -> error GraphHopperStorage newGHStorage = createStorageWithWeightings( new FastestWeighting(carEncoder), new ShortestWeighting(carEncoder)); newGHStorage.loadExisting(); }
protected Directory getDirectory() { if (dir != null) return dir; logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType + " using calcmean: " + calcMean); return dir = new GHDirectory(cacheDir.getAbsolutePath(), daType); }
private Directory getDirectory() { if (dir != null) return dir; logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType); return dir = new GHDirectory(cacheDir.getAbsolutePath(), daType); } }
private Directory getDirectory() { if (dir != null) return dir; logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType); return dir = new GHDirectory(cacheDir.getAbsolutePath(), daType); } }
private Directory getDirectory() { if (dir != null) return dir; logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType); return dir = new GHDirectory(cacheDir.getAbsolutePath(), daType); }
private Directory getDirectory() { if (dir != null) return dir; logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType); return dir = new GHDirectory(cacheDir.getAbsolutePath(), daType); } }
public void createPreparations(GraphHopperStorage ghStorage, TraversalMode traversalMode) { if (!isEnabled() || !preparations.isEmpty()) return; if (weightings.isEmpty()) throw new IllegalStateException("No CH weightings found"); traversalMode = getNodeBase(); for (Weighting weighting : getWeightings()) { PrepareContractionHierarchies tmpPrepareCH = new PrepareContractionHierarchies( new GHDirectory("", DAType.RAM_INT), ghStorage, ghStorage.getGraph(CHGraph.class, weighting), traversalMode); tmpPrepareCH.setParams(pMap); addPreparation(tmpPrepareCH); } }
public void createPreparations( GraphHopperStorage ghStorage, TraversalMode traversalMode ) { if (!isEnabled() || !preparations.isEmpty()) return; if (weightings.isEmpty()) throw new IllegalStateException("No CH weightings found"); traversalMode = getNodeBase(); for (Weighting weighting : getWeightings()) { PrepareContractionHierarchies tmpPrepareCH = new PrepareContractionHierarchies( new GHDirectory("", DAType.RAM_INT), ghStorage, ghStorage.getGraph(CHGraph.class, weighting), weighting.getFlagEncoder(), weighting, traversalMode); tmpPrepareCH.setPeriodicUpdates(preparationPeriodicUpdates). setLazyUpdates(preparationLazyUpdates). setNeighborUpdates(preparationNeighborUpdates). setLogMessages(preparationLogMessages); addPreparation(tmpPrepareCH); } }
public void createPreparations(GraphHopperStorage ghStorage, TraversalMode traversalMode) { if (!isEnabled() || !preparations.isEmpty()) return; if (weightings.isEmpty()) throw new IllegalStateException("No CH weightings found"); traversalMode = getNodeBase(); for (Weighting weighting : getWeightings()) { if (weighting instanceof GenericWeighting) { ((GenericWeighting) weighting).setGraph(ghStorage); } PrepareContractionHierarchies tmpPrepareCH = new PrepareContractionHierarchies( new GHDirectory("", DAType.RAM_INT), ghStorage, ghStorage.getGraph(CHGraph.class, weighting), weighting, traversalMode); tmpPrepareCH.setPeriodicUpdates(preparationPeriodicUpdates). setLazyUpdates(preparationLazyUpdates). setNeighborUpdates(preparationNeighborUpdates). setLogMessages(preparationLogMessages); addPreparation(tmpPrepareCH); } }
dataAccessType = DAType.MMAP_RO; GHDirectory dir = new GHDirectory(ghLocation, dataAccessType); GraphExtension ext = encodingManager.needsTurnCostsSupport() ? new TurnCostExtension() : new GraphExtension.NoOpExtension();
dataAccessType = DAType.MMAP_RO; GHDirectory dir = new GHDirectory(ghLocation, dataAccessType); GraphExtension ext = encodingManager.needsTurnCostsSupport() ? new TurnCostExtension() : new GraphExtension.NoOpExtension();
dataAccessType = DAType.MMAP_RO; GHDirectory dir = new GHDirectory(ghLocation, dataAccessType); GraphExtension ext = encodingManager.needsTurnCostsSupport() ? new TurnCostExtension() : new GraphExtension.NoOpExtension();