I’m running a local OpenRouteService instance and I can’t get the avoid_borders option to work.
Setup
ORS version: 9.1.2 (Docker)
Input data: very small .osm.pbf (≈20 × 20 km) covering the Poland–Ukraine border.
Roads were filtered and clipped to this bounding box.
I manually created and placed
borders.geojson, ids.csv, and openborders.geojson
in /home/ors/files/
Issue
The isochrone is generated successfully (no errors), but it extends across the international border between Poland and Ukraine.
What I checked
ORS log shows normal startup with no warnings about missing borders.
Without “avoid_borders” the isochrone is identical.
Question
Does ORS require the original OSM admin_level=2 relations to be present in the PBF for avoid_borders to work, even if I provide my own borders.geojson/ids.csv?
Is it possible to use a very small road extract with custom border files and still have the avoid_borders option respected?
ORS does not read the borders from OSM but from a separate file. It should work with your own files. You have to rebuild the graphs in order to have the new border files respected. AFAIK it is only supported for driving profiles.
You could check whether avoiding borders works with regular routing.
{“coordinates”:[[23.13863,49.95441],[23.09670,49.95978]]}
Both requests returned the same route.
Although I also ran the first query ( {“coordinates”:[[23.13863,49.95441],[23.09670,49.95978]],“options”:{‘avoid_borders’:“all”}}) on a cloud server, and it returned the message
“message”
:
“Route could not be found - Unable to find a route between points 1 (23.1386300 49.9544100) and 2 (23.0967000 49.9597800).”
In the graphs-folder you can also check graph_build_info.yml which contains the actual configuration with which the graph was build, so you can see whther your configuration was used.
Have you tried deleting and rebuilding the graphs?
In the ids.csv file, in the “name” column, I wrote the names of countries in the local language, i.e. ‘Polska’ and ‘ Україна’, and in the “name:en” column, I wrote the names in English (as specified in the specification), but most likely ORC does not read Cyrillic. I updated the “name” column with English names, and everything worked.
I would like to ask the developers to update or create a correct specification for the borders.geojson and ids.csv files.