Matrix - api \ server - different response

Hi
Use
api /v2/matrix/foot-walking
and docker /ors/v2/matrix/foot-walking
Input:

{
"locations":[["48.99534332782851","55.537957294968926"],["48.99548244856585","55.537923013180034"],["48.99602298695558","55.537703999410965"],["49.24409279053387","55.17862048880656"],["49.24414568757458","55.17862169904733"],["49.25985509339886","55.17556085011779"],["49.25985980555594","55.17555897259165"],["49.26429672524974","55.17377023487967"],["49.264702137256265","55.17371660498902"],["48.95617560748973","55.736464225445545"],["49.02750325785851","55.49609876818378"],["49.027578874006025","55.4959679773407"],["49.20929961078032","55.25079065207174"],["49.00354426424202","55.52838054232154"],["48.83267189756864","54.94429477743261"],["48.83294182389862","54.94821584094245"],["48.83294449200721","54.94845893042766"],["48.83294671888989","54.94855894252475"],["48.83295288031679","54.9488356599419"],["48.83297220394691","54.94970350842952"]],
"metrics":["distance"],
"sources":[0],
"units":"m"
}

api response:

 {
     "distances": [
         [
             0.0,
             9.55,
             51.67,
             59110.2,
             59106.84,
             59401.96,
             59401.6,
             59537.14,
             59563.61,
             32569.81,
             8640.25,
             8667.51,
             47971.16,
             1711.13,
             89960.68,
             89697.79,
             89670.56,
             89659.44,
             89628.66,
             89532.16
         ]
     ],
     "destinations": [
         {
             "location": [
                 48.995343,
                 55.537957
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.995482,
                 55.537923
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.996023,
                 55.537704
             ],
             "snapped_distance": 0.02
         },
         {
             "location": [
                 49.244093,
                 55.17862
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.244146,
                 55.178622
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.259855,
                 55.175561
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.25986,
                 55.175559
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.264297,
                 55.17377
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.264702,
                 55.173716
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.956176,
                 55.736464
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.027503,
                 55.496099
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 49.027579,
                 55.495968
             ],
             "snapped_distance": 0.02
         },
         {
             "location": [
                 49.2093,
                 55.250791
             ]
         },
         {
             "location": [
                 49.003611,
                 55.528399
             ],
             "snapped_distance": 4.67
         },
         {
             "location": [
                 48.832659,
                 54.944297
             ],
             "snapped_distance": 0.87
         },
         {
             "location": [
                 48.832942,
                 54.948216
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.832944,
                 54.948459
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.832947,
                 54.948559
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.832953,
                 54.948836
             ],
             "snapped_distance": 0.01
         },
         {
             "location": [
                 48.832972,
                 54.949704
             ],
             "snapped_distance": 0.01
         }
     ],
     "sources": [
         {
             "location": [
                 48.995343,
                 55.537957
             ],
             "snapped_distance": 0.01
         }
     ],
     "metadata": {
         "attribution": " | OpenStreetMap contributors",
         "service": "matrix",
         "timestamp": 1670018638608,
         "query": {
             "locations": [
                 [
                     48.99534332782851,
                     55.537957294968926
                 ],
                 [
                     48.99548244856585,
                     55.537923013180034
                 ],
                 [
                     48.99602298695558,
                     55.537703999410965
                 ],
                 [
                     49.24409279053387,
                     55.17862048880656
                 ],
                 [
                     49.24414568757458,
                     55.17862169904733
                 ],
                 [
                     49.25985509339886,
                     55.17556085011779
                 ],
                 [
                     49.25985980555594,
                     55.17555897259165
                 ],
                 [
                     49.26429672524974,
                     55.17377023487967
                 ],
                 [
                     49.264702137256265,
                     55.17371660498902
                 ],
                 [
                     48.95617560748973,
                     55.736464225445545
                 ],
                 [
                     49.02750325785851,
                     55.49609876818378
                 ],
                 [
                     49.027578874006025,
                     55.4959679773407
                 ],
                 [
                     49.20929961078032,
                     55.25079065207174
                 ],
                 [
                     49.00354426424202,
                     55.52838054232154
                 ],
                 [
                     48.83267189756864,
                     54.94429477743261
                 ],
                 [
                     48.83294182389862,
                     54.94821584094245
                 ],
                 [
                     48.83294449200721,
                     54.94845893042766
                 ],
                 [
                     48.83294671888989,
                     54.94855894252475
                 ],
                 [
                     48.83295288031679,
                     54.9488356599419
                 ],
                 [
                     48.83297220394691,
                     54.94970350842952
                 ]
             ],
             "profile": "foot-walking",
             "responseType": "json",
             "sources": [
                 "0"
             ],
             "metrics": [
                 "distance"
             ],
             "units": "m"
         },
         "engine": {
             "version": "6.8.0",
             "build_date": "2022-10-21T14:34:31Z",
             "graph_date": "2022-11-19T21:44:39Z"
         }
     }
 }

selfhost response:

 {
     "error": {
         "code": 6099,
         "message": "Unable to compute a distance/duration matrix."
     },
     "info": {
         "engine": {
             "version": "6.7.0",
             "build_date": "2022-12-02T21:29:47Z"
         },
         "timestamp": 1670018050190
     }
 }

Ors config:

 {
   "ors": {
     "info": {
       "base_url": " ***************************",
       "support_mail": "support@",
       "author_tag": "openrouteservice",
       "content_licence": "LGPL 3.0"
     },
     "services": {
       "matrix": {
         "enabled": true,
         "maximum_routes": 10000,
         "maximum_routes_flexible": 25000,
         "maximum_search_radius": 5000,
         "maximum_visited_nodes": 100000,
         "allow_resolve_locations": true,
         "attribution": ", OpenStreetMap contributors"
       },
       "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": 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": false,
               "threads": 12,
               "weightings": "recommended",
               "maxcellnodes": 5000
             },
             "profile-hgv": {
               "enabled": false,
               "threads": 12,
               "weightings": "recommended, shortest",
               "maxcellnodes": 5000
             }
           }
         },
         "maximum_intervals": 10,
         "maximum_locations": 2,
         "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": ", OpenStreetMap contributors",
         "elevation_preprocessed": false,
         "profiles": {
           "active": [
             "walking"
           ],
           "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"
       }
     ]
   }
 }

Docker logs:

02 Dec 22:01:07 INFO [routing.RoutingProfileManager] - ====> Initializing profiles from 'data/osm_file.pbf' (1 threads) ...
02 Dec 22:01:07 INFO [routing.RoutingProfileManager] -
02 Dec 22:01:07 INFO [routing.RoutingProfileManager] -
02 Dec 22:01:07 INFO [routing.RoutingProfile] - [1] Profiles: 'foot-walking', location: 'data/graphs/walking'.
02-Dec-2022 22:01:08.195 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [581] ms
02-Dec-2022 22:01:08.196 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
02-Dec-2022 22:01:08.243 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [47] ms
02-Dec-2022 22:01:08.244 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
02-Dec-2022 22:01:08.277 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [33] ms
02-Dec-2022 22:01:08.278 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
02-Dec-2022 22:01:08.316 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [37] ms
02-Dec-2022 22:01:08.335 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
02-Dec-2022 22:01:08.390 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 19881 ms
 root@89-108-77-125:~/openrouteservice/docker#

Hey,

your docker logs suggest that the openrouteservice hasn’t finished building.
What .pbf are you trying to run with?
Depending on its size, it can take the openrouteservice multiple hours to even days to fully build the graphs necessary for routing.

Has the problem resolved itself in the meantime?
If not, could you check whether the health (<ip>:<port>/ors/v2/health) and status site (<ip>:<port>/ors/v2/status) report ready or an actual status?

If the health says ready, could you use some of your locations to run with regular routing, i.e. against the directions endpoint?

Best regards

Thx, problem was in RAM and xmx param in docker-compose.yml

for 601139K OSM PBF 3GB RAM + 1800m xmx enough for comfort running ( java 2134mb, 2.55Gb - full using with not huge db+nginx)

1 Like