Working ors-config.yml

Hi!!

Can anyone point me or share with me a working ors-config.yml for running jar, to use with matrix and car profile? I tried to use the default one, only changing the source_file and enabling the car profile, it didn’t work. Then I found this more compact config here on this forum:

ors:
  ### uncomment the following lines to change CORS settings.
  #cors:
  #  allowed_origins: "*"
  #  allowed_headers: Content-Type, X-Requested-With, accept, Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization
  #  preflight_max_age: 600
  engine:
    ### use the following line for development setup using test OSM file for Heidelberg
    #source_file: ./src/test/files/heidelberg.osm.gz
    source_file: /Volumes/TOSHIBA/calculadora/brazil-latest.osm.pbf
    graphs_root_path: /Volumes/TOSHIBA/calculadora/ors-core/data/graphs
    elevation:
      cache_path: /Volumes/TOSHIBA/calculadora/ors-core/data/elevation_cache

    profiles:
      car:
        profile: driving-car
        elevation: true
        encoder_options:
          turn_costs: true
          block_fords: false
          use_acceleration: true
        preparation:
          min_network_size: 200
          min_one_way_network_size: 200
          methods:
            ch:
              enabled: true
              threads: 1
              weightings: fastest
            lm:
              enabled: false
              threads: 1
              weightings: fastest,shortest
              landmarks: 16
            core:
              enabled: true
              threads: 1
              weightings: fastest,shortest
              landmarks: 64
              lmsets: highways;allow_all
        execution:
          methods:
            ch:
              disabling_allowed: true
            lm:
              disabling_allowed: true
              active_landmarks: 6
            core:
              disabling_allowed: true
              active_landmarks: 6
        ext_storages:
          WayCategory:
          HeavyVehicle:
          WaySurfaceType:
          RoadAccessRestrictions:
            use_for_warnings: true

But it complaints about:

2024-08-02 09:18:46 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]
2024-08-02 09:18:46 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   No profiles configured. Exiting.

I’m trying to run the jar with java -jar ors.jar and after that (still can’t though), call it via python, using:

ors = client.Client(base_url="http://localhost:8082/ors")

    profile = 'driving-car'
    matrix_parameters = {
        'locations': latlons_lista,
        'sources': [0],
        'profile': profile,
        'metrics': ['duration', "distance"]
    }

    matrix = ors.distance_matrix(**matrix_parameters)

Many thanks!!

Hi,

I think in your config the car profile is not enabled. Try to add enabled: true nested in your profiles.car:

ors:
  engine:
    profiles:
      car:
        enabled: true

Thanks for your help!
At some point I had it enabled, but when trying to access http://localhost:8082/ors/v2/health I’m getting a {"status":"not ready"}.
I will copy here the log from running the jar. I know that the .pbf file is good because I’ve used it already when I was using r5r package in R.

Log:

2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.Application                      ]   Starting Application v8.1.1 using Java 21.0.3 with PID 2735 (/Users/barana/ors/ors.jar started by barana in /Users/barana/ors)
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.Application                      ]   The following 1 profile is active: "default"
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.ORSEnvironmentPostProcessor      ]
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.ORSEnvironmentPostProcessor      ]   Configuration lookup started.
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.ORSEnvironmentPostProcessor      ]   Configuration file lookup by default locations.
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.ORSEnvironmentPostProcessor      ]   Loaded file './ors-config.yml'
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.ORSEnvironmentPostProcessor      ]   Configuration lookup finished.
2024-08-05 14:49:22 INFO                                                  main [ o.h.o.a.ORSEnvironmentPostProcessor      ]
2024-08-05 14:49:23 INFO                                              ORS-Init [ o.h.o.a.s.l.ORSInitContextListener       ]   Initializing ORS...
2024-08-05 14:49:23 INFO                                              ORS-Init [ o.h.o.r.RoutingProfileManager            ]   Total - 105 MB, Free - 53,44 MB, Max: 2 GB, Used - 51,56 MB
2024-08-05 14:49:23 INFO                                              ORS-Init [ o.h.o.r.RoutingProfileManager            ]   ====> Initializing profiles from '/Volumes/TOSHIBA/calculadora/brazil-latest.osm.pbf' (1 threads) ...
2024-08-05 14:49:23 INFO                                              ORS-Init [ o.h.o.r.RoutingProfileManager            ]   1 profile configurations submitted as tasks.
2024-08-05 14:49:23 INFO                                            ORS-pl-car [ o.h.o.r.RoutingProfile                   ]   [1] Profiles: 'driving-car', location: '/Volumes/TOSHIBA/calculadora/ors-core/data/graphs/car'.
2024-08-05 14:49:23 INFO                                            ORS-pl-car [ o.h.o.r.g.e.c.CoreLMPreparationHandler   ]   Loaded landmark splitting collection from
2024-08-05 14:49:23 INFO                                                  main [ o.h.o.a.Application                      ]   Started Application in 2.162 seconds (process running for 2.977)
2024-08-05 14:49:23 INFO                                                  main [ o.h.o.a.Application                      ]   openrouteservice {"build_date":"2024-07-17T08:53:00Z","version":"8.1.1"}
2024-08-05 14:49:23 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   version v4.9.1|2024-01-17T09:08:46Z (7,20,5,4,5,7)
2024-08-05 14:49:23 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   graph CH|car_ors|RAM_STORE|3D|turn_cost|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308, shortcuts:0 (0MB), nodesCH:-1 (0MB), shortcuts:0 (0MB), nodesCH:-1 (0MB), shortcuts:0 (0MB), nodesCH:-1 (0MB)
2024-08-05 14:49:24 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   No custom areas are used, custom_areas.directory not given
2024-08-05 14:49:24 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   start creating graph from /Volumes/TOSHIBA/calculadora/brazil-latest.osm.pbf
2024-08-05 14:49:24 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   using CH|car_ors|RAM_STORE|3D|turn_cost|,,,,, memory:totalMB:126, usedMB:47

→ see health endpoint docs.
graphs are still building. This can take quite a while for large pbf files, depending on your machine specs.