/** * Enable memory mapped configuration if not enough memory is available on the target platform. */ public GraphHopper setMemoryMapped() { ensureNotLoaded(); dataAccessType = DAType.MMAP; return this; }
/** * Not yet stable enough to offer it for everyone */ private GraphHopper setUnsafeMemory() { ensureNotLoaded(); dataAccessType = DAType.UNSAFE_STORE; return this; }
/** * Sorts the graph which requires more RAM while import. See #12 */ public GraphHopper setSortGraph(boolean sortGraph) { ensureNotLoaded(); this.sortGraph = sortGraph; return this; }
/** * Precise location resolution index means also more space (disc/RAM) could be consumed and * probably slower query times, which would be e.g. not suitable for Android. The resolution * specifies the tile width (in meter). */ public GraphHopper setPreciseIndexResolution(int precision) { ensureNotLoaded(); preciseIndexResolution = precision; return this; }
/** * This method call results in an in-memory graph. */ public GraphHopper setInMemory() { ensureNotLoaded(); dataAccessType = DAType.RAM_STORE; return this; }
/** * This method specifies if the import should include way names to be able to return * instructions for a route. */ public GraphHopper setEnableInstructions(boolean b) { ensureNotLoaded(); enableInstructions = b; return this; }
/** * Only valid option for in-memory graph and if you e.g. want to disable store on flush for unit * tests. Specify storeOnFlush to true if you want that existing data will be loaded FROM disc * and all in-memory data will be flushed TO disc after flush is called e.g. while OSM import. * * @param storeOnFlush true by default */ public GraphHopper setStoreOnFlush(boolean storeOnFlush) { ensureNotLoaded(); if (storeOnFlush) dataAccessType = DAType.RAM_STORE; else dataAccessType = DAType.RAM; return this; }
/** * Sets the graphhopper folder. */ public GraphHopper setGraphHopperLocation(String ghLocation) { ensureNotLoaded(); if (ghLocation == null) throw new IllegalArgumentException("graphhopper location cannot be null"); this.ghLocation = ghLocation; return this; }
/** * This method specifies the preferred language for way names during import. * <p> * Language code as defined in ISO 639-1 or ISO 639-2. * <ul> * <li>If no preferred language is specified, only the default language with no tag will be * imported.</li> * <li>If a language is specified, it will be imported if its tag is found, otherwise fall back * to default language.</li> * </ul> */ public GraphHopper setPreferredLanguage(String preferredLanguage) { ensureNotLoaded(); if (preferredLanguage == null) throw new IllegalArgumentException("preferred language cannot be null"); this.preferredLanguage = preferredLanguage; return this; }
/** * Enables or disables contraction hierarchies (CH). This speed-up mode is enabled by default. */ public GraphHopper setCHEnabled(boolean enable) { ensureNotLoaded(); chFactoryDecorator.setEnabled(enable); return this; }
/** * Specify which vehicles can be read by this GraphHopper instance. An encoding manager defines * how data from every vehicle is written (und read) into edges of the graph. */ public GraphHopper setEncodingManager(EncodingManager em) { ensureNotLoaded(); this.encodingManager = em; if (em.needsTurnCostsSupport()) traversalMode = TraversalMode.EDGE_BASED_2DIR; return this; }
/** * This file can be any file type supported by the DataReader. E.g. for the OSMReader it is the * OSM xml (.osm), a compressed xml (.osm.zip or .osm.gz) or a protobuf file (.pbf) */ public GraphHopper setDataReaderFile(String dataReaderFileStr) { ensureNotLoaded(); if (isEmpty(dataReaderFileStr)) throw new IllegalArgumentException("Data reader file cannot be empty."); dataReaderFile = dataReaderFileStr; return this; }
/** * This method call results in an in-memory graph. */ public GraphHopper setInMemory() { ensureNotLoaded(); dataAccessType = DAType.RAM_STORE; return this; }
/** * Sorts the graph which requires more RAM while import. See #12 */ public GraphHopper setSortGraph( boolean sortGraph ) { ensureNotLoaded(); this.sortGraph = sortGraph; return this; }
/** * Precise location resolution index means also more space (disc/RAM) could be consumed and * probably slower query times, which would be e.g. not suitable for Android. The resolution * specifies the tile width (in meter). */ public GraphHopper setPreciseIndexResolution(int precision) { ensureNotLoaded(); preciseIndexResolution = precision; return this; }
/** * Sorts the graph which requires more RAM while import. See #12 */ public GraphHopper setSortGraph(boolean sortGraph) { ensureNotLoaded(); this.sortGraph = sortGraph; return this; }
/** * Sets the graphhopper folder. */ public GraphHopper setGraphHopperLocation(String ghLocation) { ensureNotLoaded(); if (ghLocation == null) throw new IllegalArgumentException("graphhopper location cannot be null"); this.ghLocation = ghLocation; return this; }
/** * Specify which vehicles can be read by this GraphHopper instance. An encoding manager defines * how data from every vehicle is written (und read) into edges of the graph. */ public GraphHopper setEncodingManager(EncodingManager em) { ensureNotLoaded(); this.encodingManager = em; if (em.needsTurnCostsSupport()) traversalMode = TraversalMode.EDGE_BASED_2DIR; return this; }
/** * Enables or disables contraction hierarchies (CH). This speed-up mode is enabled by default. */ public GraphHopper setCHEnabled( boolean enable ) { ensureNotLoaded(); chFactoryDecorator.setEnabled(enable); return this; }
/** * This file can be an osm xml (.osm), a compressed xml (.osm.zip or .osm.gz) or a protobuf file * (.pbf). */ public GraphHopper setOSMFile( String osmFileStr ) { ensureNotLoaded(); if (Helper.isEmpty(osmFileStr)) throw new IllegalArgumentException("OSM file cannot be empty."); osmFile = osmFileStr; return this; }