Graphs for all profiles are always built under /graphs

Hello,

I am trying to save up time and RAM resources while running the engine for spain-latets.osm.pbf. I need only matrix and isochrones for foot-walk and driving-car profiles. In app.config I restrict routes to enabled: false.

I also restrict at the isochrones section the maximum_range_time and maxim_range_distance, by using only the profiles I need and removing the section:

{
“profiles”:“any”
}

And yet I see whenever I do docker-compose up that all the graphs for all the profiles are built. In this order: Vehicle-car, Vehicle-hgv, bike, pedestrian-walk

I checked the documentation for app.config and does not mention this issue. What is happening? How can I strip down the graphs so that I build only what I need? Thanks!

What’s your docker-compose? Did you rebuild the image after editing the app.config?

My docker compose is:

version: ‘3’
services:
ors-app:
container_name: ors-app
ports:
- 8080:8080
build:
context: …/
args:
APP_CONFIG: ./docker/conf/app.config
OSM_FILE: ./docker/data/spain-latest.osm.pbf
volumes:
- ./graphs:/ors-core/data/graphs
- ./elevation_cache:/ors-core/data/elevation_cache
- ./logs/ors/:/var/log/ors/
- ./logs/tomcat/:/usr/local/tomcat/logs
- ./conf/app.config:/ors-core/openrouteservice/target/classes/app.config
- ./data/spain-latest.osm.pbf:/ors-core/data/osm_file.pbf
environment:
- BUILD_GRAPHS=True # Forces the container to rebuild the graphs, e.g. when PBF is changed in app.config
- JAVA_OPTS="-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms10g -Xmx10g -XX:MaxMetaspaceSize=512m -XX:-UseGCOverheadLimit"
- CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost"

Regarding rebuilding the image, I assumed the image was rebuild at docker-compose up. If it is not that was the issue. If I need to do docker-compose build and then docker-compose up then that was a mistake from my side… Thanks a lot!! Really!

You can shortcut to docker-compose up -d --build.

But you’re using the new setup, so actually you’re right. Since you specified BUILD_GRAPHS=True, it should build new graphs regardless.

Are you sure:

  • you edited ./conf/app.config?
  • you actually edited this sectrion?

            "profiles":{
               "active":[
                   "vehicles-car",
                   "vehicles-hgv",
                   "bike",
                   "pedestrian-walk"
               ],

If so, I’ll need to try it myself.

Best to include your app.config as well (and please do me the favor to properly format code).

And can you do a tree . in the docker directory?

Yes, I edited and removed the profiles-> active that I am not interested in.
As you could see, I my attempt to make the engine pick up the configuration, I tried dumb things like isochornes (profiles “any” value 0 ).

    {
   "ors":{
 "info": {
   "base_url": "https://openrouteservice.org/",
   "support_mail": "support@openrouteservice.org",
   "author_tag": "openrouteservice",
   "content_licence": "LGPL 3.0"
  },
  "services":{
     "matrix":{
        "enabled":true,
        "maximum_locations":2,
        "maximum_visited_nodes":1000,
        "allow_resolve_locations":true,
        "attribution":"openrouteservice.org, OpenStreetMap contributors"
     },
     "isochrones":{
        "enabled":true,
        "maximum_range_distance":[
           {
              "profiles":"any",
              "value":0
           },
           {
              "profiles":"driving-car, foot-walking",
              "value":20000
           }
           {
              "profiles":"foot-walking",
              "value":3000
           }
        ],
        "maximum_range_time":[
           {
              "profiles":"any",
              "value":0
           },
           {
              "profiles":"driving-car, foot-walking",
              "value":3600
           }

        ],
        "maximum_intervals":10,
        "maximum_locations":2,
        "allow_compute_area":true,
        "attribution":"openrouteservice.org, OpenStreetMap contributors"
     },
     "routing":{
        "enabled":false,
        "mode":"preparation",
        "sources":[
           "data/osm_file.pbf"
        ],
        "init_threads":1,
        "attribution":"openrouteservice.org, OpenStreetMap contributors",
        "distance_approximation":true,
        "profiles":{
           "active":[
               "vehicles-car",
               "pedestrian-walk"
           ],
           "default_params": {
               "encoder_flags_size": 8,
               "graphs_root_path": "data/graphs",
               "elevation_provider": "multi",
                   "elevation_cache_path": "data/elevation_cache",
               "elevation_clear_cache": false,
               "instructions": false,
               "maximum_distance": 30000,
               "maximum_segment_distance_with_dynamic_weights": 10000,
               "maximum_distance_round_trip_routes": 10000,
               "maximum_waypoints": 50
               "maximum_avoid_polygon_area": 200000000,
               "maximum_avoid_polygon_extent": 20000,
           },
           "profile-vehicles-car":{
              "profiles":"driving-car",
              "parameters":{
                 "encoder_options":"consider_elevation=false|turn_costs=true|block_fords=false|use_acceleration=true",
                 "elevation":false,
                 "preparation":{
                    "min_network_size":200,
                    "min_one_way_network_size":200,
                    "methods":{
                       "ch":{
                          "enabled":false,
                          "threads":8,
                          "weightings":"fastest"
                       },
                       "lm":{
                          "enabled":true,
                          "threads":8,
                          "weightings":"fastest,shortest",
                          "landmarks":24
                       }
                    }
                 },
                 "execution":{
                    "methods":{
                       "astar":{
                          "approximation":"BeelineSimplification",
                          "epsilon":1
                       },
                       "ch":{
                          "disabling_allowed":true
                       },
                       "lm":{
                          "disabling_allowed":true,
                          "active_landmarks":6
                       }
                    }
                 },
                 "ext_storages":{
                    "WayCategory":{

                    },
                    "WaySurfaceType":{

                    },
                    "Tollways":{

                    }
                 }
              }
           },
           "profile-vehicles-hgv":{
              "profiles":"driving-hgv",
              "parameters":{
                 "encoder_options":"consider_elevation=false|turn_costs=true|block_fords=false|use_acceleration=true",
                 "elevation":false,
                 "preparation":{
                    "min_network_size":200,
                    "min_one_way_network_size":200,
                    "methods":{
                       "ch":{
                          "enabled":false,
                          "threads":8,
                          "weightings":"fastest"
                       },
                       "lm":{
                          "enabled":true,
                          "threads":8,
                          "weightings":"fastest,shortest",
                          "landmarks":24
                       }
                    }
                 },
                 "execution":{
                    "methods":{
                       "astar":{
                          "approximation":"BeelineSimplification",
                          "epsilon":1
                       },
                       "ch":{
                          "disabling_allowed":true
                       },
                       "lm":{
                          "disabling_allowed":true,
                          "active_landmarks":6
                       }
                    }
                 },
                 "ext_storages":{
                    "WayCategory":{

                    },
                    "HeavyVehicle":{
                       "restrictions":true
                    },
                    "WaySurfaceType":{

                    },
                    "Tollways":{

                    }
                 }
              }
           },
           "profile-bike":{
              "profiles":"cycling-regular",
              "parameters":{
                 "encoder_options":"consider_elevation=false|turn_costs=true|block_fords=false",
                 "elevation":false,
                 "preparation":{
                    "min_network_size":200,
                    "min_one_way_network_size":200,
                    "methods":{
                       "ch":{
                          "enabled":false,
                          "threads":8,
                          "weightings":"fastest"
                       },
                       "lm":{
                          "enabled":true,
                          "threads":8,
                          "weightings":"fastest,shortest",
                          "landmarks":24
                       }
                    }
                 },
                 "execution":{
                    "methods":{
                       "astar":{
                          "approximation":"BeelineSimplification",
                          "epsilon":1
                       },
                       "ch":{
                          "disabling_allowed":true
                       },
                       "lm":{
                          "disabling_allowed":true,
                          "active_landmarks":6
                       }
                    }
                 },
                 "ext_storages":{
                    "WayCategory":{

                    },
                    "WaySurfaceType":{

                    },
                    "HillIndex":{

                    },
                    "TrailDifficulty":{

                    }
                 }
              }
           },
           "profile-pedestrian-walk":{
              "profiles":"foot-walking",
              "parameters":{
                 "encoder_options":"consider_elevation=false|turn_costs=false|block_fords=false",
                 "elevation":false,
                 "preparation":{
                    "min_network_size":200,
                    "min_one_way_network_size":200,
                    "methods":{
                       "ch":{
                          "enabled":false,
                          "threads":8,
                          "weightings":"fastest"
                       },
                       "lm":{
                          "enabled":true,
                          "threads":8,
                          "weightings":"fastest,shortest",
                          "landmarks":24
                       }
                    }
                 },
                 "execution":{
                    "methods":{
                       "astar":{
                          "approximation":"BeelineSimplification",
                          "epsilon":1
                       },
                       "ch":{
                          "disabling_allowed":true
                       },
                       "lm":{
                          "disabling_allowed":true,
                          "active_landmarks":6
                       }
                    }
                 },
                 "ext_storages":{
                    "WayCategory":{

                    },
                    "WaySurfaceType":{

                    },
                    "HillIndex":{

                    },
                    "TrailDifficulty":{

                    }
                 }
              }
           }
        }
     }
  },
  "logging": {
      "enabled": true,
      "level_file": "PRODUCTION_LOGGING.json",
      "location": "/var/log/ors",
      "stdout": true
  },
  system_message: [
      {
          active: false,
          text: "This message would be sent with every routing bike fastest request",
          condition: {
              "request_service": "routing",
              "request_profile": "cycling-regular,cycling-mountain,cycling-road,cycling-electric",
              "request_preference": "fastest"
          }
      },
      {
          active: false,
          text: "This message would be sent with every request for geojson response",
          condition: {
              "api_format": "geojson"
          }
      },
      {
          active: false,
          text: "This message would be sent with every request on API v1 from January 2020 until June 2050",
          condition: {
              "api_version": 1,
              "time_after": "2020-01-01T00:00:00Z",
              "time_before": "2050-06-01T00:00:00Z"
          }
      },
      {
          active: false,
          text: "This message would be sent with every request"
      }
  ]
   }
}
.

├── conf
│ ├── app.config
│ ├── catalina.properties
│ └── sample
├── data
│ ├── elevation_cache
│ │ └── srtm_38_03.zip
│ ├── heidelberg.osm.gz
│ └── spain-latest.osm.pbf
├── docker-compose.yml
├── elevation_cache
│ ├── srtm_33_07.gh
│ ├── srtm_33_07.zip
│ ├── srtm_35_03.gh
│ ├── srtm_35_03.zip
│ ├── srtm_35_04.gh
│ ├── srtm_35_04.zip
│ ├── srtm_35_05.gh
│ ├── srtm_35_05.zip
│ ├── srtm_36_02.gh
│ ├── srtm_36_02.zip
│ ├── srtm_36_03.gh
│ ├── srtm_36_03.zip
│ ├── srtm_36_04.gh
│ ├── srtm_36_04.zip
│ ├── srtm_36_05.gh
│ ├── srtm_36_05.zip
│ ├── srtm_37_04.gh
│ ├── srtm_37_04.zip
│ ├── srtm_37_05.gh
│ ├── srtm_37_05.zip
│ ├── srtm_38_03.gh
│ ├── srtm_38_03.zip
│ ├── srtm_38_04.gh
│ ├── srtm_38_04.zip
│ ├── srtm_39_04.gh
│ └── srtm_39_04.zip
├── graphs
│ └── vehicles-car
│ └── gh.lock
├── logs
│ ├── ors
│ │ └── ors.log
│ └── tomcat
│ ├── catalina.2020-04-22.log
│ ├── host-manager.2020-04-22.log
│ ├── localhost.2020-04-22.log
│ ├── localhost_access_log.2020-04-22.txt
│ └── manager.2020-04-22.log
└── README.md

The issue was that I did not do docker-compose build in between app.config changes. Now I came back to an app.config.sample, removed all profiles from the route->profiles->active except pedestrian-walk and now it started building the graph for pedestrian-walk first.

Thanks a lot Nils! Outstanding work you guys are doing here.

Good to hear!

Still, that’s a bug. It should’ve rebuilt the graphs with your new settings without an image rebuild. That was the whole reason why we rearranged the docket stuff. Let me dig in tmrw.