Local ORS Instance Failing to Create Isochrones

I have recently set up an instance of the openrouteservice API on a virtual machine, where the graphs were built using data from Geofabrik .

When requesting isochrones in certain geographical areas (often urban areas) I sometimes get empty responses from the api.

From looking at the docker logs

sudo docker logs ors-app

I see logs like this.

16 Sep 00:09:25 DEBUG [fast.FastIsochroneMapBuilder] - Poly of cell 14341 is invalid at size 0

For context, I have been attempting to generate many isochrones in a grid format, so often I will get many results like this where the cell number is the same.

Is this a problem with the data that I used, or with how the graphs were built during the initial setup?

Any advice would be appreciated.

Hey,

your problem is unfortunately quite unspecific:

Could you specify

  • the osm or pbf file you’re using
  • your complete request
  • your ors-config.json iff you changed something
  • a bit of info about your ORS setup

That would help us to recreate and debug the problem.
Best regards

1 Like

Thanks for getting back to me, Jakob.

I ran in to this problem while using the the spain-latest.osm.pbf file from Geofabrik, as well as while using a merged Spain, Great Britain, and France “-latest” osm.pbf file which I merged together using the osmium-tool “cat” function (stackexchange)

I will show the complete request to an instance that uses the original spain-latest.osm.pbf file.
I’m making the query with Python code.

import requests
data = {'locations': [[-3.832116, 40.53188]], 'range': [300]}
response = requests.post(my_url, json=data)
log.debug(data)
log.debug(response)
log.debug(response.content)

Output:

2021-09-28 10:50:06,113 tools.iso_gen DEBUG    {'locations': [[-3.832116, 40.53188]], 'range': [300]}
2021-09-28 10:50:06,113 tools.iso_gen DEBUG    <Response [500]>
2021-09-28 10:50:06,113 tools.iso_gen DEBUG    b'{"error":{"code":3099,"message":"Unable to build an isochrone map."},"info":{"engine":{"version":"6.6.1","build_date":"2021-09-14T13:56:02Z"},"timestamp":1632822606018}}'

config

{
  "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_routes": 100,
        "maximum_routes_flexible": 25,
        "maximum_search_radius": 5000,
        "maximum_visited_nodes": 100000,
        "allow_resolve_locations": true,
        "attribution": "openrouteservice.org, OpenStreetMap contributors"
      },
      "isochrones": {
        "enabled": true,
        "maximum_range_distance": [
          {
            "profiles": "any",
            "value": 100000
          },
          {
            "profiles": "driving-car, driving-hgv",
            "value": 100000
          }
        ],
        "maximum_range_time": [
          {
            "profiles": "any",
            "value": 18000
          },
          {
            "profiles": "driving-car, driving-hgv",
            "value": 3600
          }
        ],
        "fastisochrones": {
          "maximum_range_distance": [
            {
              "profiles": "any",
              "value": 50000
            },
            {
              "profiles": "driving-car, driving-hgv",
              "value": 500000
            }
          ],
          "maximum_range_time": [
            {
              "profiles": "any",
              "value": 18000
            },
            {
              "profiles": "driving-car, driving-hgv",
              "value": 10800
            }
          ],
          "profiles": {
            "default_params": {
              "enabled": true,
              "threads": 12,
              "weightings": "recommended",
              "maxcellnodes": 5000
            },
            "profile-hgv": {
              "enabled": true,
              "threads": 12,
              "weightings": "recommended, shortest",
              "maxcellnodes": 5000
            }
          }
        },
        "maximum_intervals": 10,
        "maximum_locations": 150,
        "allow_compute_area": true
      },
      "routing": {
        "enabled": true,
        "mode": "normal",
        "routing_description": "This is a routing file from openrouteservice",
        "routing_name": "openrouteservice routing",
        "sources": [
          "data/osm_file.pbf"
        ],
        "init_threads": 1,
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "elevation_preprocessed": false,
        "profiles": {
          "active": [
            "bike-electric"
          ],
          "default_params": {
            "encoder_flags_size": 8,
            "graphs_root_path": "data/graphs",
            "elevation_provider": "multi",
            "elevation_cache_path": "data/elevation_cache",
            "elevation_cache_clear": false,
            "instructions": true,
            "maximum_distance": 100000,
            "maximum_distance_dynamic_weights": 100000,
            "maximum_distance_avoid_areas": 100000,
            "maximum_waypoints": 50,
            "maximum_snapping_radius": 400,
            "maximum_avoid_polygon_area": 200000000,
            "maximum_avoid_polygon_extent": 20000,
            "maximum_distance_alternative_routes": 100000,
            "maximum_alternative_routes": 3,
            "maximum_distance_round_trip_routes": 100000,
            "maximum_speed_lower_bound": 80,
            "preparation": {
              "min_network_size": 200,
              "min_one_way_network_size": 200,
              "methods": {
                "lm": {
                  "enabled": true,
                  "threads": 1,
                  "weightings": "recommended,shortest",
                  "landmarks": 16
                }
              }
            },
            "execution": {
              "methods": {
                "lm": {
                  "disabling_allowed": true,
                  "active_landmarks": 8
                }
              }
            }
          },
          "profile-car": {
            "profiles": "driving-car",
            "parameters": {
              "encoder_flags_size": 8,
              "encoder_options": "turn_costs=true|block_fords=false|use_acceleration=true",
              "maximum_distance": 100000,
              "elevation": true,
              "maximum_snapping_radius": 350,
              "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
                }
              }
            }
          },
          "profile-hgv": {
            "profiles": "driving-hgv",
            "parameters": {
              "encoder_flags_size": 8,
              "encoder_options": "turn_costs=true|block_fords=false|use_acceleration=true",
              "maximum_distance": 100000,
              "elevation": true,
              "preparation": {
                "min_network_size": 200,
                "min_one_way_network_size": 200,
                "methods": {
                  "ch": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended"
                  },
                  "core": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended,shortest",
                    "landmarks": 64,
                    "lmsets": "highways;allow_all"
                  }
                }
              },
              "execution": {
                "methods": {
                  "ch": {
                    "disabling_allowed": true
                  },
                  "core": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  }
                }
              },
              "ext_storages": {
                "WayCategory": {},
                "HeavyVehicle": {
                  "restrictions": true
                },
                "WaySurfaceType": {}
              }
            }
          },
          "profile-bike-regular": {
            "profiles": "cycling-regular",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-mountain": {
            "profiles": "cycling-mountain",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-road": {
            "profiles": "cycling-road",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-electric": {
            "profiles": "cycling-electric",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-walking": {
            "profiles": "foot-walking",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-hiking": {
            "profiles": "foot-hiking",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-wheelchair": {
            "profiles": "wheelchair",
            "parameters": {
              "encoder_options": "block_fords=true",
              "elevation": true,
              "maximum_snapping_radius": 50,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "Wheelchair": {
                  "KerbsOnCrossings": "true"
                },
                "OsmId": {}
              }
            }
          }
        }
      }
    },
    "logging": {
      "enabled": true,
      "level_file": "DEBUG_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"
      }
    ]
  }
}

ORS Setup
I followed the ors guide and used docker-compose up -d to use the docker container.
It’s running on a virtual machine which has 4 cpus and 16gb ram and it is running ubuntu-2004-focal-v20210825.

OS Description

Canonical, Ubuntu, 20.04 LTS, amd64 focal image built on 2021-08-25, supports Shielded VM features

Please let me know if I can provide any further details.

Thanks,
Peter

Hey,

I’ve been able to reproduce the second error you reported, but I don’t see any logs like the first you reported.
Is this a result of the request?

Best regards

I actually don’t get the logged response after this specific query. But do you know why it is not returning a response in this case?

Here is an example of a query that will result in the logging of

29 Sep 14:15:47 DEBUG [fast.FastIsochroneMapBuilder] - Poly of cell 24840 is invalid at size 0

import requests
data = {'locations': [[-3.825567209356647, 40.216321073185], [-3.825603686295581, 40.23435418468709], [-3.8256082472669815, 40.236608318021595], [-3.826249767780785, 40.55217297872929], [-3.7848925535039153, 40.55897658278202]], 'range': [1500]}
response = requests.post(my_url, json=data)
log.debug(data)
log.debug(response)
log.debug(response.content)

2021-09-29 15:15:48,003 tools.iso_gen DEBUG {‘locations’: [[-3.825567209356647, 40.216321073185], [-3.825603686295581, 40.23435418468709], [-3.8256082472669815, 40.236608318021595], [-3.826249767780785, 40.55217297872929], [-3.7848925535039153, 40.55897658278202]], ‘range’: [1500]}
2021-09-29 15:15:48,003 tools.iso_gen DEBUG <Response [500]>
2021-09-29 15:15:48,003 tools.iso_gen DEBUG b’{“error”:{“code”:3099,“message”:“Unable to build an isochrone map.”},“info”:{“engine”:{“version”:“6.6.1”,“build_date”:“2021-09-14T13:56:02Z”},“timestamp”:1632924947905}}’

However there does not appear to be any error when attempting to fetch isochrones with any individual pair of these 5 coordinates.

@jschnell Hi Jakob,
Have you had a chance to look at this since the last time?
I’ve been running in to the problem time and time again. Any recommendations would be great! Is there something in the configuration that I should change?

Thanks.

Hey,

I’m still not able to generate any debug log output as you state.
Could you post your complete log, please? I’d like to check whether we’re building the same thing :slight_smile:

Also, please provide your docker-compose.yml.

Thanks