ORS stuck when creating graph with European borders enabled

Hello,

I successfully built the Europe map with ORS (about 12 hours, no problems or errors).
However, when I enable the European borders (add all the boundaries etc.), the build starts but then gets stuck during graph creation. I don’t get any errors, only the following log output:

ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.r.b.CountryBordersReader     ]   Border geometries read
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.r.b.CountryBordersReader     ]   37 countries read in 1 hiearchies
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.r.b.CountryBordersReader     ]   37 country IDs read
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.r.b.CountryBordersReader     ]   Border ids data read
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.r.b.CountryBordersReader     ]   Border openness data read
ors-app  | 2025-08-18 12:20:45 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)
ors-app  | 2025-08-18 12:20:45 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)
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   No custom areas are used, custom_areas.directory not given
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   start creating graph from /home/ors/files/europe-latest.osm.pbf
ors-app  | 2025-08-18 12:20:45 INFO                                            ORS-pl-car [ o.h.o.r.g.e.ORSGraphHopper               ]   using CH|car_ors|RAM_STORE|3D|turn_cost|,,,,, memory:totalMB:24576, usedMB:902

At this point the process doesn’t move forward. I let it run for almost 3 days, but it still never finished creating the graph, and the status remains “not ready.”

When I disable borders, the build works fine.
When I enable borders, no errors appear, but it seems to hang indefinitely.

Here my configuration:

server:
  port: 8080
  error:
    whitelabel:
      enabled: false
  enabled: true
ors:
  cors:
  engine:
    source_file: /home/ors/files/europe-latest.osm.pbf
    profile_default:
      service:
        maximum_distance: 100000000
    profiles:
      car:
        encoder_name: driving-car
        enabled: true
        elevation: true
        extra_info:
          - countryinfo
        ext_storages:
          WayCategory:
          HeavyVehicle:
          WaySurfaceType:
          Borders:
            preprocessed: false
            boundaries: /home/ors/borders/borders.geojson
            ids: /home/ors/borders/ids.csv
            openborders: /home/ors/borders/openborders.csv

Hey,

I’d guess that this is due to a data format issue with your input files.

Could you make sure that the files are indeed where they are configured to be?

Could you post one polygon from your geojson file, along with the corresponding entry from ids.csv and one corresponding entry from openborders.csv?

Best regards

1 Like

The geojson is really big, but here is a part:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [...]
      },
      "properties": {
        "osm_id": -14296,
        "name": "Slovensko",
        "name_en": "Slovakia",
        "boundary": "administrative",
        "admin_level": 2,
        "admin_centre_node_id": 530544342,
        "admin_centre_node_lat": 48.1516988,
        "admin_centre_node_lng": 17.1093063,
        "label_node_id": 432425079,
        "label_node_lat": 48.7411522,
        "label_node_lng": 19.4528646
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [...]
      },
      "properties": {
        "osm_id": -16239,
        "name": "Österreich",
        "name_en": "Austria",
        "boundary": "administrative",
        "admin_level": 2,
        "admin_centre_node_id": 17328659,
        "admin_centre_node_lat": 48.2083537,
        "admin_centre_node_lng": 16.3725042,
        "label_node_id": 26847709,
        "label_node_lat": 47.59397,
        "label_node_lng": 14.12456
      }
    }
  ]
}

Additionally it created the geojson from:

Here an example for ids.csv:

country_id,name,name:en,iso_code_cca2,iso_code_cca3
1,Slovensko,Slovakia,SK,SVK
2,Österreich,Austria,AT,AUT

Here an example for openborders.csv:

country1,country2
Austria,Slovakia

Hey,

the one difference that I’d assign meaning to, in comparison to what we deploy, is that our openborders.csv doesn’t have a “header row”, it immediately starts with the first pair.

Could you check whether that changes something?

Best regards

No actually, country1 and country 2 is the header.
Like here:

In the documentation the borders.geojson is loaded as borders.geojson.tar.gz… would this make any difference, because I am directly adding the file as borders.geojson. I did not thought that, as the log says it is loaded without any error.

Does anyone have any ideas on this?

Hi @ibodc

it could very well be to do with the structure of how the countries are in your geojson file. The geometries that we use in building are not simply one polygon for each country, but rather several smaller polygons (ideally with as few vertices as possible). My guess is that you are using the polygons that represent the entire country, and this would drastically increase the processing time (and I mean drastically) as every single node in the graph needs to have a point in polygon calculation performed which is quite a costly operation.

Your best bet would be to use some GIS software such as QGIS to split your countries on a regular grid (e.g. one decimal degree) and then use that as your polygon file (see the image below for the DACH region of Europe - the larger rectangles are simply where multiple squares have been merged).

To speed things up even more, you can use “hierarchies” which are bigger areas that group the polygons together. these hierarchies would be something like 10 decimal degree grids (see below), and again speed up the processing.

In the image below, you can see how the selected polygons have the attributes relating to their country and the hierarchy.

Hopefully that helps

3 Likes

Yes, this solution worked! Thanks a lot!

2 Likes