Unable to build isochrone map locally for walking but possible for car

Hello,

I have a local backend running using the latest docker image on an ubuntu kernel using wsl2.

For building graphs I’ve downloaded and used the latest pbf file for germany from Geofarbik. Graph building seems to work fine and I can build isochrones for the profile driving-car, but not for foot-walking.

My docker-compose.yml looks like this:

version: '2.4'
services:
  ors-app:
    container_name: ors-app
    ports:
      - "8080:8080"
      - "9001:9001"
    image: openrouteservice/openrouteservice:latest
    user: "${UID:-0}:${GID:-0}"
    # build:
    #   context: ./
    #   args:
    #     ORS_CONFIG: ./conf/ors-config.json
    #     OSM_FILE: ./data/germany-latest.osm.pbf
    volumes:
      - ./graphs:/home/ors/data/graphs
      - ./elevation_cache:/home/ors/data/elevation_cache
      - ./logs/ors:/var/log/ors
      - ./logs/tomcat:/usr/local/tomcat/logs
      - ./conf:/home/ors/ors-conf
      - /data/germany-latest.osm.pbf:/home/ors/data/osm_file.pbf
    environment:
      - BUILD_GRAPHS=False  # Forces the container to rebuild the graphs, e.g. when PBF is changed
      - "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx24g"
      - "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"

My ors-config.json looks like this:

{
  "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": 500000
            },
            {
              "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": false,
              "threads": 12,
              "weightings": "recommended",
              "maxcellnodes": 5000
            },
            "profile-hgv": {
              "enabled": false,
              "threads": 12,
              "weightings": "recommended, shortest",
              "maxcellnodes": 5000
            }
          }
        },
        "maximum_intervals": 10,
        "maximum_locations": 10000,
        "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": [
            "walking",
            "car",
            "bike-regular"
          ],
          "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"
      }
    ]
  }
}

The pbf file and the config file are both present in the container and I copied the graph files to /home/ors/ors-core/data/ too. Same for the elevation_cache.

I’m sure lon/lat are correct and when I use your API I get and Isochrone response, so it must be something with my backend.

The error is just:

({'error': {'code': 3099, 'message': 'Unable to build an isochrone map.'}, 'info': {'engine': {'version': '7.0.1', 'build_date': '2023-03-08T12:06:41Z'}, 'timestamp': 1678638604922}})

A dry-run for example like this:

url:
http://localhost:8080/ors/v2/isochrones/foot-walking/geojson?
Headers:
{
  "headers": {
    "User-Agent": "ORSClientPython.v2.2.2",
    "Content-type": "application/json",
    "Authorization": null
  },
  "timeout": 6000,
  "json": {
    "locations": [
      [
        13.4468831,
        52.4728711
      ]
    ],
    "profile": "foot-walking",
    "range_type": "time",
    "range": [
      600
    ]
  }
}

Any help or ideas where I could look for a solution? Thanks so much in advance!

Hi @bagdenaj,

could you please also provide the log output of the container, especially the part during the graph building? Probably there went something wrong with building the foot-walking graph.

So the same request works for both driving-car and cycling-regular?

Normally you shouldn’t need to copy around graph or elevation_cache files, as they should be managed via the volumes.

Best regards

Hi @amandus ,

thanks for the quick reply.

I can’t find the log output of the container for building the graph anymore. I will delete the current graphs builded and start new. The I will provide the logs.

And no, it only works for driving-car. foot-walking and cycling-regular both throw the same error.

This is the output when I try to request a isochrone with the above data from the dry-run:

2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - Find edges: 0.002764427
2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - Mark dead ends: 3.28203E-4
2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - Expanding edges 0.0
2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - 0 Find points: 5.63406E-4 2

Here is the output while building the graphs for foot-walking:

ors-app  | 13 Mar 13:23:28 INFO [routing.RoutingProfileManager] -  Total - 1.45 GB, Free - 1.33 GB, Max: 24 GB, Used - 119.07 MB
ors-app  | 13 Mar 13:23:28 INFO [routing.RoutingProfileManager] -       
ors-app  | 13 Mar 13:23:28 INFO [routing.RoutingProfileManager] - ====> Initializing profiles from 'data/osm_file.pbf' (1 threads) ...
ors-app  | 13 Mar 13:23:28 INFO [routing.RoutingProfileManager] - 3 tasks submitted.
ors-app  | 13-Mar-2023 13:23:28.326 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/home/ors/tomcat/webapps/ors.war] has finished in [13,694] ms
ors-app  | 13-Mar-2023 13:23:28.334 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/ors/tomcat/webapps/manager]
ors-app  | 13-Mar-2023 13:23:28.403 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/ors/tomcat/webapps/manager] has finished in [68] ms
ors-app  | 13-Mar-2023 13:23:28.403 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/ors/tomcat/webapps/examples]
ors-app  | 13 Mar 13:23:28 INFO [routing.RoutingProfile] - [1] Profiles: 'foot-walking', location: 'data/graphs/walking'.
ors-app  | 13-Mar-2023 13:23:28.671 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/ors/tomcat/webapps/examples] has finished in [268] ms
ors-app  | 13-Mar-2023 13:23:28.672 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/ors/tomcat/webapps/docs]
ors-app  | 13-Mar-2023 13:23:28.691 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/ors/tomcat/webapps/docs] has finished in [19] ms
ors-app  | 13-Mar-2023 13:23:28.691 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/ors/tomcat/webapps/ROOT]
ors-app  | 13-Mar-2023 13:23:28.717 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/ors/tomcat/webapps/ROOT] has finished in [26] ms
ors-app  | 13-Mar-2023 13:23:28.718 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/ors/tomcat/webapps/host-manager]
ors-app  | 13-Mar-2023 13:23:28.748 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/ors/tomcat/webapps/host-manager] has finished in [30] ms
ors-app  | 13-Mar-2023 13:23:28.761 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
ors-app  | 13-Mar-2023 13:23:28.779 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 14254 ms
ors-app  | 13 Mar 13:23:28 INFO [extensions.ORSGraphHopper] - version 4.0|2023-03-03T11:19:19Z (7,20,5,4,5,7)
ors-app  | 13 Mar 13:23:28 INFO [extensions.ORSGraphHopper] - graph pedestrian_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
ors-app  | 13 Mar 13:23:29 INFO [extensions.ORSGraphHopper] - No custom areas are used, custom_areas.directory not given
ors-app  | 13 Mar 13:23:29 INFO [extensions.ORSGraphHopper] - start creating graph from data/osm_file.pbf
ors-app  | 13 Mar 13:23:29 INFO [extensions.ORSGraphHopper] - using pedestrian_ors|RAM_STORE|3D|turn_cost|,,,,, memory:totalMB:1480, usedMB:140
ors-app  | 13 Mar 13:35:13 INFO [extensions.ORSGraphHopper] - call cleanUp for 'data/graphs/walking' 
ors-app  | 13 Mar 13:35:13 INFO [extensions.ORSGraphHopper] - graph pedestrian_ors|RAM_STORE|3D|turn_cost|7,20,5,4,5, details:edges:24 102 451(828MB), nodes:18 671 687(357MB), name:(55MB), geo:108 241 837(413MB), bounds:5.8630797,25.1965582,47.2491573,60.2200367,-86.0,2933.0
ors-app  | 13 Mar 13:35:13 INFO [extensions.ORSGraphHopper] - will create PrepareRoutingSubnetworks with:
ors-app  |      NodeCountBefore: '18671687'
ors-app  |      getAllEdges().getMaxId(): '24102451'
ors-app  |      List<FlagEncoder>: '[pedestrian_ors]'
ors-app  |      minNetworkSize: '200'
ors-app  |      minOneWayNetworkSize: '200'
ors-app  | 13 Mar 13:36:31 INFO [extensions.ORSGraphHopper] - nodes: 18 671 687, edges: 24 102 451
ors-app  | 13 Mar 13:36:36 INFO [extensions.ORSGraphHopper] - Bridge interpolation 2s, tunnel interpolation 1s, ferry interpolation 1s
 ors-app  | 13 Mar 14:28:18 INFO [extensions.ORSGraphHopper] - flushing graph pedestrian_ors|RAM_STORE|3D|turn_cost|7,20,5,4,5, details:edges:24 102 451(828MB), nodes:18 671 687(357MB), name:(55MB), geo:108 241 837(413MB), bounds:5.8630797,25.1965582,47.2491573,60.2200367,-86.0,2933.0, totalMB:19184, usedMB:7131)
ors-app  | 13 Mar 14:28:25 INFO [extensions.ORSGraphHopper] - flushed graph totalMB:19184, usedMB:7838)
ors-app  | 13 Mar 14:28:25 INFO [routing.RoutingProfile] - [1] Edges: 24102451 - Nodes: 18671687.
ors-app  | 13 Mar 14:28:25 INFO [routing.RoutingProfile] - [1] Total time: 3896.819s.
ors-app  | 13 Mar 14:28:25 INFO [routing.RoutingProfile] - [1] Finished at: 2023-03-13 14:28:25.

After building the graphs new car-driving now also doesn’t work… -.-

Here is the complete log for building the graphs.

Hi @amandus,

any idea what could be wrong and why cars now also don’t work? I’m at the end of wits.

Many thanks :upside_down_face:

Hey @bagdenaj,

is it still the same problem? So getting {'code': 3099, 'message': 'Unable to build an isochrone map.'} for the request above with different profiles?
And this error log:

2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - Find edges: 0.002764427
2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - Mark dead ends: 3.28203E-4
2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - Expanding edges 0.0
2023-03-13 14:21:13 13 Mar 13:21:13 DEBUG [concaveballs.ConcaveBallsIsochroneMapBuilder] - 0 Find points: 5.63406E-4 2

The only thing i can see right now is the memory that is close to maximum ors graph building logs · GitHub which might be an issue. But normally it should result in an error when it runs out of memory.

Yes, still the same error, same problem.

I will increase the memory, just in case, and get back to you.

Okay. I increased the memory to 72G but that didn’t change anything. Not even the percentage is going down:

ors-app  | 15 Mar 16:14:58 INFO [routing.RoutingProfileManager] - ========================================================================
ors-app  | 15 Mar 16:14:58 INFO [routing.RoutingProfileManager] - ====> Recycling garbage...
ors-app  | 15 Mar 16:14:58 INFO [routing.RoutingProfileManager] - Before:  Total - 37.92 GB, Free - 25.53 GB, Max: 72 GB, Used - 12.39 GB
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - After:  Total - 37.92 GB, Free - 26.27 GB, Max: 72 GB, Used - 11.65 GB
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - ========================================================================
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - ====> Memory usage by profiles:
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - [1] 3.99 GB (34.2%)
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - [2] 3.03 GB (26.0%)
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - [3] 3.95 GB (33.9%)
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - Total: 10.97 GB (94.2%)
ors-app  | 15 Mar 16:15:01 INFO [routing.RoutingProfileManager] - ========================================================================

Okay, car is working again. That was just a spelling error on my part. Now it’s back to the original problem. driving-car is working, foot-walking and cycling-regular are not. The time range and locations are all the same. Build is like the one above. Memory is now at 72G.

Hey,

this output (if it is not preceeded by any errors) looks quite promising :slight_smile:
Could you provide the actual queries you’re trying and the responses you’re getting?

Is this consistent across the profile, or are you able to get other isochrones, just not the one with the concrete locations from above?

Is routing working with these coordinates?

Best regards

Ah yes! I complied a list of 145 points and iterated over everyone to calculate an isochrone for every single point.

To my surprise for some points in this list it’s not possible to calculate isochrones for foot-walking and cycling-regular, but every point in the list works with driving-car. So it seems to work in general but just not the same for every profile / point.

Do you know what could be the reason for this?

Another thing is what to do about it now. To me it seems to be much faster to calculate isochrones when passing a list of coordinates to the API rather then iterating over every point and append the result to a FeatureCollection depending on the result. Is that true? Or wouldn’t it matter if I pass one or a hundert points to the api?

Also it would be nice to have a more precise error message at this point to know why the calculation was failing.