I’m trying to setup self-hosted ORS. Mostly it works fine, but I have found an unexpected behaviour when compared to your demo website. It seems that the problem is destination in restricted access area.
Your service provides a route to the closest possible point: https://maps.openrouteservice.org/directions?n1=50.064011&n2=22.028567&n3=18&a=50.294603,21.439535,50.063806,22.028875&b=0&c=0&k1=en-US&k2=km
My service for the same request:
{"preference":"recommended","language":"en-US","instructions":false,"geometry":true,"elevation":true,"coordinates":[[21.439535,50.294603],[22.028875,50.063806]]}
responds with:
{"error":{"code":2009,"message":"Route could not be found - Unable to find a route between points 1 (21.4395350 50.2946030) and 2 (22.0288750 50.0638060)."},"info":{"engine":{"version":"6.3.0","build_date":"2020-10-16T11:13:23Z"},"timestamp":1602846914237}}
I’ve tested it with both “car” and “hgv” profiles. The result is the same. The behaviour from your demo website is good, how can I configure my service to get similar result?
By the way: in case of a matrix request it returns 0 as a distance. Shouldn’t it be null
?
My configuration file:
{
"ors": {
"services": {
"isochrones": {
"enabled": false
},
"mapmatching": {
"enabled": false
},
"matrix": {
"enabled": true,
"maximum_routes": 10000,
"maximum_routes_flexible": 25,
"maximum_search_radius": 5000,
"maximum_visited_nodes": 1000000,
"allow_resolve_locations": false,
"attribution": "openrouteservice.org, OpenStreetMap contributors"
},
"routing": {
"enabled": true,
"mode": "normal",
"routing_name": "openrouteservice routing",
"sources": [
"data/osm_file.pbf"
],
"init_threads": 4,
"attribution": "openrouteservice.org, OpenStreetMap contributors",
"elevation_preprocessed": false,
"profiles": {
"active": [
"car", "hgv"
],
"default_params": {
"encoder_flags_size": 8,
"graphs_root_path": "data/graphs",
"elevation": false,
"elevation_provider": "multi",
"elevation_cache_path": "data/elevation_cache",
"elevation_cache_clear": false,
"instructions": false,
"maximum_distance": 10000000,
"maximum_distance_dynamic_weights": 10000000,
"maximum_distance_avoid_areas": 1000000,
"maximum_waypoints": 200,
"maximum_snapping_radius": 10000,
"maximum_avoid_polygon_area": 200000000,
"maximum_avoid_polygon_extent": 20000,
"maximum_distance_alternative_routes": 10000000,
"maximum_alternative_routes": 0,
"maximum_distance_round_trip_routes": 20000000,
"maximum_speed_lower_bound": 80,
"preparation": {
"min_network_size": 200,
"min_one_way_network_size": 200,
},
"execution": {
"methods": {
"ch": {
"disabling_allowed": true
},
"lm": {
"disabling_allowed": true,
"active_landmarks": 8
},
"core": {
"disabling_allowed": true,
"active_landmarks": 8
}
}
}
},
"profile-car": {
"profiles": "driving-car",
"parameters": {
"encoder_options": "turn_costs=true|block_fords=false|use_acceleration=false",
"preparation": {
"methods": {
"ch": {
"enabled": true,
"threads": 4,
"weightings": "fastest"
},
"lm": {
"enabled": false,
"threads": 4,
"weightings": "fastest,shortest",
"landmarks": 16
},
"core": {
"enabled": true,
"threads": 4,
"weightings": "fastest,shortest",
"landmarks": 64,
"lmsets": "highways;allow_all"
}
}
},
"ext_storages": {
"WayCategory": {},
"HeavyVehicle": {},
"WaySurfaceType": {},
"RoadAccessRestrictions": {
"use_for_warnings": true
}
}
}
},
"profile-hgv": {
"profiles": "driving-hgv",
"parameters": {
"encoder_options": "turn_costs=true|block_fords=false|use_acceleration=false",
"preparation": {
"methods": {
"ch": {
"enabled": true,
"threads": 4,
"weightings": "recommended"
},
"lm": {
"enabled": true,
"threads": 4,
"weightings": "recommended,shortest",
"landmarks": 16
},
"core": {
"enabled": true,
"threads": 4,
"weightings": "recommended,shortest",
"landmarks": 64,
"lmsets": "highways;allow_all"
}
}
},
"ext_storages": {
"WayCategory": {},
"HeavyVehicle": {
"restrictions": true
},
"WaySurfaceType": {}
}
}
},
}
}
},
"logging": {
"enabled": true,
"level_file": "DEBUG_LOGGING.json",
"location": "/var/log/ors",
"stdout": true
},
"system_message": []
}
}