@Override public GHResponse route(GHRequest request) { GHResponse response = new GHResponse(); calcPaths(request, response); return response; }
/** * Enable memory mapped configuration if not enough memory is available on the target platform. */ public GraphHopper setMemoryMapped() { ensureNotLoaded(); dataAccessType = DAType.MMAP; return this; }
/** * This file can be an osm xml (.osm), a compressed xml (.osm.zip or .osm.gz) or a protobuf file * (.pbf). */ public GraphHopperOSM setOSMFile(String osmFileStr) { super.setDataReaderFile(osmFileStr); return this; }
/** * Configures the underlying storage to be used on a less powerful machine like Android or * Raspberry Pi with only few MB of RAM. */ public GraphHopper forMobile() { setSimplifyResponse(false); return setMemoryMapped(); }
@Override public RoutingAlgorithmFactory createRoutingFactory() { return hopper.getAlgorithmFactory(lmHints); } });
/** * Configures the underlying storage to be used on a Desktop computer or within another Java * application with enough RAM but no network latency. */ public GraphHopper forDesktop() { setSimplifyResponse(false); return setInMemory(); }
/** * This method enabled or disables the speed mode (Contraction Hierarchies) * * @deprecated use {@link #setCHEnabled(boolean)} instead */ public GraphHopper setCHEnable(boolean enable) { return setCHEnabled(enable); }
/** * @return time in millis */ public long getTime() { check("getTimes"); return time; }
/** * Add stopover point to routing request. * <p> * * @param point geographical position (see GHPoint) */ public GHRequest addPoint(GHPoint point) { addPoint(point, Double.NaN); return this; }
/** * For testing only */ protected GraphHopper loadGraph(GraphHopperStorage g) { this.ghStorage = g; fullyLoaded = true; initLocationIndex(); return this; }
public GraphHopper setElevationProvider(ElevationProvider eleProvider) { if (eleProvider == null || eleProvider == ElevationProvider.NOOP) setElevation(false); else setElevation(true); this.eleProvider = eleProvider; return this; }
@Override public GHRequest setPointHints(List<String> pointHints) { super.setPointHints(pointHints); this.fromPointHints = pointHints; this.toPointHints = pointHints; return this; }
@Override public boolean goFurther(int nodeId) { counter++; return counter < graphHopper.getMaxVisitedNodes(); } };
@Override public RoutingAlgorithmFactory createRoutingFactory() { return hopper.getAlgorithmFactory(chHints); } });
/** * This method returns all points on the path. Keep in mind that calculating the distance from * these points might yield different results compared to getDistance as points could have been * simplified on import or after querying. */ public PointList getPoints() { check("getPoints"); return pointList; }
/** * Not yet stable enough to offer it for everyone */ private GraphHopper setUnsafeMemory() { ensureNotLoaded(); dataAccessType = DAType.UNSAFE_STORE; return this; }
/** * This method returns the input points snapped to the road network. */ public PointList getWaypoints() { check("getWaypoints"); return waypointList; }
/** * Sorts the graph which requires more RAM while import. See #12 */ public GraphHopper setSortGraph(boolean sortGraph) { ensureNotLoaded(); this.sortGraph = sortGraph; return this; }
/** * This method returns the distance of the path. Always prefer this method over * getPoints().calcDistance * <p> * * @return distance in meter */ public double getDistance() { check("getDistance"); return distance; }
/** * This method returns a double value which is better than the time for comparison of routes but * only if you know what you are doing, e.g. only to compare routes gained with the same query * parameters like vehicle. */ public double getRouteWeight() { check("getRouteWeight"); return routeWeight; }