Long distance isochrones

Hi @adam,

thanks for the reply. Indeed it looks like the parameter was set wrong. I adapted it as follows, however it is still not working:

{
“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”: 500000 },
{ “profiles”: “driving-car, driving-hgv, foot-walking”, “value”: 500000 }
],
“maximum_range_time”: [
{ “profiles”: “any”, “value”: 18000 },
{ “profiles”: “driving-car, driving-hgv, foot-walking”, “value”: 10800 }
],
“fastisochrones”: {
“maximum_range_distance”: [
{ “profiles”: “any”, “value”: 50000 },
{ “profiles”: “driving-car, driving-hgv, foot-walking”, “value”: 500000 }
],
“maximum_range_time”: [
{ “profiles”: “any”, “value”: 18000 },
{ “profiles”: “driving-car, driving-hgv, foot-walking”, “value”: 10800 }
],
“profiles”: {
“default_params”: {
“enabled”: false,
“threads”: 12,
“weightings”: “recommended”,
“maxcellnodes”: 5000
},
“profile-vehicles-hgv”: {
“enabled”: true,
“threads”: 12,
“weightings”: “recommended, shortest”,
“maxcellnodes”: 5000
}
}

I believe that my docker parameters are wrong, since none of the changes from the app.config I provide are present in the bash of the container itself.

I believe the maxcellnodes is something completely separate from the search radius. I’m not sure how to pass the parameter for the search radius in isochrones is, hopefully @HendrikLeuschner or @andrzej know

Hi,

no need to worry about the maxcellnodes parameter.
Under the fastisochrones parameters, you have them disabled (enabled:false) for all profiles except hgv. If you want them for car or anything else, you need to add those profiles separately in the same manner as “profile-vehicles-hgv” or set the default profile as enabled.
In addition, the profile you want has to be enabled under routing.active in the later parts of the config.
But I agree with you that it seems your app.config does not seem to be used in docker. I think this is something maybe @adam knows more about.

Hi,

can maybe someone outline the default process on how to increase the isochrones max_time using docker? The approach used by me seems to be not working.

Thanks!

Hi,

I was able to find a solution to my problem of the app.config not being used inside my docker container. It is definitely not elegant but works for me, maybe someone finds it helpful going forward:

  1. Modify the app.config.sample in /openrouteservice/src/main/resources/ as follows:


“isochrones”: {
“enabled”: true,
“maximum_range_distance”: [
{ “profiles”: “any”, “value”: 50000 },
{ “profiles”: “driving-car, driving-hgv”, “value”: 100000 }
],
“maximum_range_time”: [
{ “profiles”: “any”, “value”: 18000 },
{ “profiles”: “driving-car, driving-hgv”, “value”: 10800 }
],

  1. Delete the docker images you have on your host using: docker images and docker rmi (I believe this one is not needed to be honest)
  2. Create a new image from the root of your project folder using

docker build --tag YOURNAME:YOURVERSION #e.g. ors-custom:1 .

  1. Start the container using the following command from the root of your project (customise to your need)

docker run -dt
–name ors-app
-p 8080:8080
-v $PWD/docker/graphs:/ors-core/data/graphs
-v $PWD/docker/elevation_cache:/ors-core/data/elevation_cache
-v $PWD/docker/germany-latest.osm.pbf:/ors-core/data/osm_file.pbf
-e “JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx11g”
-e “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”
YOURNAME:YOURVERSION

Afterwards the container is being created and once build, you are able to request isochrones calls within the limit you provided above.
Short remark: If you are using the python library for accessing ors, you have to increase the timeout parameter of the client function (default = 60), since ORS takes e.g. around 90-100s for a 4800s isochrones call.

Hope it helps someone, also I am open for cleaner solutions!

@HendrikLeuschner @adam

Looking to test out the 6 hour window. I have QGIS and the ORS Tools plugin installed. Running on Windows 10.

What items need to be changed?

Plugin install path

%AppData%\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ORStools

Hi @ThePie,

you need a local openrouteservice Instance to use the fast isochrones calculation as we can currently not offer this on our official API.
Once you have that set up, you can change the provider to http://localhost:8082/ors or whatever port you are running it under.

Best regards

Thanks for the reply @amandus.

I have Docker running on localhost and am using the below for my provider.
image

docker run -dt --name=ors-app `
  -p 8080:8080 `
  -v C:\Users\User\Documents\openrouteservice\graphs:/ors-core/data/graphs `
  -v C:\Users\User\Documents\openrouteservice\elevation_cache:/ors-core/data/elevation_cache `
  -v C:\Users\User\Documents\openrouteservice\conf:/ors-conf `
  -e "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g" `
  -e "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" `
  openrouteservice/openrouteservice:latest

I am getting the below error however. Is there something I am missing via the setup?

Feature ID None caused a GenericServerError:
500 ({“error”:{“code”:3099,“message”:“Unable to build an isochrone map.”},“info”:{“engine”:{“version”:“6.6.1”,“build_date”:“2021-10-14T05:50:59Z”},“timestamp”:1634229022830}})

The status page looks good as well.
http://localhost:8080/ors/v2/status

{"engine":{"version":"6.6.1","build_date":"2021-10-14T05:50:59Z"},"services":["routing","isochrones","matrix","mapmatching"],"languages":["de","de-de","en","en-us","es","es-es","fr","fr-fr","gr","gr-gr","he","he-il","hu","hu-hu","id","id-id","it","it-it","ja","ja-jp","ne","ne-np","nl","nl-nl","pl","pl-pl","pt","pt-pt","ru","ru-ru","tr","tr-tr","zh","zh-cn"],"profiles":{"profile 1":{"profiles":"driving-car","creation_date":"","storages":{"Tollways":{},"WayCategory":{},"WaySurfaceType":{}},"limits":{"maximum_distance":100000,"maximum_waypoints":50}},"profile 2":{"profiles":"driving-hgv","creation_date":"","storages":{"Tollways":{},"WayCategory":{},"HeavyVehicle":{"restrictions":"true"},"WaySurfaceType":{}},"limits":{"maximum_distance":100000,"maximum_waypoints":50}},"profile 3":{"profiles":"cycling-regular","creation_date":"","storages":{"HillIndex":{},"WayCategory":{},"WaySurfaceType":{},"TrailDifficulty":{}},"limits":{"maximum_distance":100000,"maximum_waypoints":50}},"profile 4":{"profiles":"foot-walking","creation_date":"","storages":{"HillIndex":{},"WayCategory":{},"WaySurfaceType":{},"TrailDifficulty":{}},"limits":{"maximum_distance":100000,"maximum_waypoints":50}}}}

Hey,

what osm file are you using? Are you sure it is available in your docker container?
What is the request you’re issuing? Are you sure its coordinates are in the file you are trying to use?

If you don’t specify any osm file, it’ll use the default one for Heidelberg (Germany). Try to generate some routes there, if that works, that’s it :slight_smile:

Best regards

It seems I need the OpenStreetMap PBF file as I can create routes from that town in Germany.

PBF files from the below website look like they might be what I need? Currently downloading one, however the bandwidth rate is only 100 KB/s so it will take a while.
https://download.geofabrik.de/north-america.html

@jschnell
I added the OSM PBF variable to the Docker container and re-created the container.
Also included the BUILD_GRAPHS environment variable.

docker run -dt --name=ors-app `
  -p 8080:8080 `
  -v C:\Users\User\Documents\openrouteservice\graphs:/ors-core/data/graphs `
  -v C:\Users\User\Documents\openrouteservice\elevation_cache:/ors-core/data/elevation_cache `
  -v C:\Users\User\Documents\openrouteservice\conf:/ors-conf `
  -v C:\Users\User\Documents\openrouteservice\us-latest.osm.pbf:/ors-core/data/osm_file.pbf `
  -e BUILD_GRAPHS=True `
  -e "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g" `
  -e "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" `
  openrouteservice/openrouteservice:latest

http://localhost:8080/ors/v2/health shows unready.
Docker container shows the below:
https://pastebin.com/raw/ucFdvfMk

Hey,

you’re running out of heap space for java:

 java.lang.OutOfMemoryError: Java heap space

This setting is controlled by the -Xms and -Xmx-option in the -e "JAVA_OPTS…" option.
-Xmx defines the maximum memory a jvm may allocate, and -Xms defines the initial memory the jvm will allocate.

If you’re trying to build north-america for all profiles (see the active profile list in your config), you’ll need quite a lot of memory - as a rule of thumb, about twice the size of the .pbf is needed per profile.

I’d recommend to de-activate all but the needed profiles (i.e., delete them from the list).

Best regards

Thanks for the info @jschnell.

I am currently using the us-latest.osm.pbf file which is about 8.1 GB. I set the Xmx var to -Xmx20g this time around. The machine only has 32GB of memory and seems like it ran out. So I am trying to use the us-midwest file which is around 2 GB.

Here is the Docker Log file after creating the container. Was unable to use the service as the health check never was ready. Waited over a hour.
https://pastebin.com/raw/PUC0NRMs

Tried “restarting” the container, but the outcome is the same.

If you’re trying to build north-america for all profiles (see the active profile list in your config), you’ll need quite a lot of memory - as a rule of thumb, about twice the size of the .pbf is needed per profile .

If I know I am only going to use 1 profile, is there a way I can disable the other profiles in the ors-config.json file?

Figured I need to update the config to the below:

            "profiles":{
               "active":[
                   "vehicles-car"
               ],

Hey,

two small comments:
For one, building such a large graph will take time. As an example, building spain (around 900mb) on my machine takes roughly one hour for building a single profile, so a wait for multiple hours for us-midwest or even longer for us-latest wouldn’t surprise me at all.

Secondly, I think that car instead of vehicles-car should do it.

Best regards

@jschnell
The below is my modified config file. I copied that from the app.config.sample file from the GitHub project.

ors-config.json
https://pastebin.com/raw/qiCg9H1s

Building spain (around 900mb) on my machine takes roughly one hour for building a single profile

Is there a debugging option to see the loading progress by chance?

/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\networkaccessmanager.py", line 262, in request
raise self.exception_class(self.http_call_result.reason)
ORStools.common.networkaccessmanager.RequestsExceptionTimeout: Network error: Operation canceled

Also, is it possible to increase the time out?

I found the below issue on GitHub. Made a comment and waiting for a response.

Hi @jschnell I also got this Generic Server error: 500.

I believe I have everything set up well because yesterday I ran a diving-car matrix successfully. And now to run for walking-foot it showed the error below:

Traceback (most recent call last):
File “C:/Users/ppec/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\client.py”, line 162, in request
blocking=True)
File “C:/Users/ppec/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\networkaccessmanager.py”, line 262, in request
raise self.exception_class(self.http_call_result.reason)
ORStools.common.networkaccessmanager.RequestsExceptionTimeout: Network error: Operation canceled

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:/Users/ppec/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\matrix_proc.py”, line 248, in processAlgorithm
response = clnt.request(’/v2/matrix/’ + profile, {}, post_json=params)
File “C:/Users/ppec/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\client.py”, line 166, in request
raise exceptions.Timeout
ORStools.utils.exceptions.Timeout

A execução falhou após 61.51 segundos

I tested selecting a smaller number of features and the error was:
How can I solve this?

GenericServerError: 500 ({“error”:{“code”:6099,“message”:“Unable to compute a distance/duration matrix.”},“info”:{“engine”:{“version”:“6.7.0”,“build_date”:“2022-02-18T19:37:41Z”},“timestamp”:1647078285144}})

Traceback (most recent call last):
File “C:/Users/ppec/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\matrix_proc.py”, line 275, in processAlgorithm
duration = response[‘durations’][s][d]
UnboundLocalError: local variable ‘response’ referenced before assignment

A execução falhou após 12.63 segundos

Hey,

the 1.5.0 release of the qgis plugin lets you set a custom timeout for every ors provider you enter, so I’d recommend you update.

Do you have access to the logs that the openrouteservice is generating on the failed GenericServerError request? That’d be helpful for debugging.
Without that, just from the conversation atop, maybe the active profiles are not set? For walking this should just be walking.

Best regards

Thank you jschnell! I´ll try that.

1 Like

Hi folks! I’m just back here to ask - was the extended isochrone functionality ever installed? And if not, how difficult would it be to set up a locally hosted version of the software? Are there any other alternatives?

I only need 3 hour isochrones for a few locations in Malaysia.

Thanks so much!

Hi @ishanaratan

currently still needs a local adjusted openrouteservice instance.
The difficulty to set that up depends on your experience with that kind of stuff, but you can calculate at least a few hours as a minimum if you have never done it.

Best regards