diff --git a/ors-engine/src/main/java/org/heigit/ors/routing/RoutingProfile.java b/ors-engine/src/main/java/org/heigit/ors/routing/RoutingProfile.java index c127c363fb..61618715b6 100644 --- a/ors-engine/src/main/java/org/heigit/ors/routing/RoutingProfile.java +++ b/ors-engine/src/main/java/org/heigit/ors/routing/RoutingProfile.java @@ -178,7 +178,7 @@ public static ORSGraphHopper initGraphHopper(EngineConfig engineConfig, RoutePro private static ORSGraphHopperConfig createGHSettings(String sourceFile, RouteProfileConfiguration config) { ORSGraphHopperConfig ghConfig = new ORSGraphHopperConfig(); - ghConfig.putObject("graph.dataaccess", "RAM_STORE"); + ghConfig.putObject("graph.dataaccess", config.getGraphDataAccess()); ghConfig.putObject("datareader.file", sourceFile); ghConfig.putObject("graph.location", config.getGraphPath()); ghConfig.putObject("graph.bytes_for_flags", config.getEncoderFlagsSize()); diff --git a/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RouteProfileConfiguration.java b/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RouteProfileConfiguration.java index 75a9d7cd53..d9a027a01b 100644 --- a/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RouteProfileConfiguration.java +++ b/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RouteProfileConfiguration.java @@ -66,6 +66,7 @@ public class RouteProfileConfiguration { private boolean turnCostEnabled = false; private boolean enforceTurnCosts = false; + private String graphDataAccess = "RAM_STORE"; public RouteProfileConfiguration() { extStorages = new HashMap<>(); @@ -367,4 +368,55 @@ public int getMaximumVisitedNodesPT() { public void setMaximumVisitedNodesPT(int maximumVisitedNodesPT) { this.maximumVisitedNodesPT = maximumVisitedNodesPT; } + + public String getGraphDataAccess() { + return graphDataAccess; + } + + public void setGraphDataAccess(String graphDataAccess) { + this.graphDataAccess = graphDataAccess; + } + + @Override + public String toString() { + return "RouteProfileConfiguration{" + + "name='" + name + '\'' + + ", enabled=" + enabled + + ", profiles='" + profiles + '\'' + + ", graphPath='" + graphPath + '\'' + + ", extStorages=" + extStorages + + ", graphBuilders=" + graphBuilders + + ", maximumDistance=" + maximumDistance + + ", maximumDistanceDynamicWeights=" + maximumDistanceDynamicWeights + + ", maximumDistanceAvoidAreas=" + maximumDistanceAvoidAreas + + ", maximumDistanceAlternativeRoutes=" + maximumDistanceAlternativeRoutes + + ", maximumDistanceRoundTripRoutes=" + maximumDistanceRoundTripRoutes + + ", maximumWayPoints=" + maximumWayPoints + + ", instructions=" + instructions + + ", optimize=" + optimize + + ", encoderFlagsSize=" + encoderFlagsSize + + ", encoderOptions='" + encoderOptions + '\'' + + ", gtfsFile='" + gtfsFile + '\'' + + ", isochronePreparationOpts=" + isochronePreparationOpts + + ", preparationOpts=" + preparationOpts + + ", executionOpts=" + executionOpts + + ", elevationProvider='" + elevationProvider + '\'' + + ", elevationCachePath='" + elevationCachePath + '\'' + + ", elevationDataAccess='" + elevationDataAccess + '\'' + + ", elevationCacheClear=" + elevationCacheClear + + ", elevationSmoothing=" + elevationSmoothing + + ", interpolateBridgesAndTunnels=" + interpolateBridgesAndTunnels + + ", maximumSnappingRadius=" + maximumSnappingRadius + + ", extent=" + extent + + ", hasMaximumSnappingRadius=" + hasMaximumSnappingRadius + + ", locationIndexResolution=" + locationIndexResolution + + ", locationIndexSearchIterations=" + locationIndexSearchIterations + + ", maximumSpeedLowerBound=" + maximumSpeedLowerBound + + ", trafficExpirationMin=" + trafficExpirationMin + + ", maximumVisitedNodesPT=" + maximumVisitedNodesPT + + ", turnCostEnabled=" + turnCostEnabled + + ", enforceTurnCosts=" + enforceTurnCosts + + ", graphDataAccess='" + graphDataAccess + '\'' + + '}'; + } } diff --git a/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java b/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java index e0ab28a1e0..252ec1bac8 100644 --- a/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java +++ b/ors-engine/src/main/java/org/heigit/ors/routing/configuration/RoutingManagerConfiguration.java @@ -28,6 +28,7 @@ import java.util.Map; public class RoutingManagerConfiguration { + public static final String PARAM_GRAPH_DATA_ACCESS = "graph_data_access"; public static final String PARAM_ELEVATION_CACHE_CLEAR = "elevation_cache_clear"; public static final String PARAM_ELEVATION_DATA_ACCESS = "elevation_data_access"; public static final String PARAM_ELEVATION_SMOOTHING = "elevation_smoothing"; @@ -106,6 +107,9 @@ else if (defaultParams != null) { if (profileParams != null) { for (Map.Entry paramItem : profileParams.entrySet()) { switch (paramItem.getKey()) { + case PARAM_GRAPH_DATA_ACCESS: + profile.setGraphDataAccess(StringUtility.trimQuotes(paramItem.getValue().toString())); + break; case "preparation": profile.setPreparationOpts(ConfigFactory.parseString(paramItem.getValue().toString())); break;