[OSRM-talk] Oneway sample: No route found vs Impossible route
Mateusz Loskot
mateusz at loskot.net
Mon Feb 20 12:51:25 UTC 2017
Hi,
I'm playing with one way restrictions and I noticed
curious result I'm getting in response to my routing queries
which I can't explain (I haven't dug into the implementation details).
I'm trying OSM file generated for one of the OSRM test scenarios,
namely "Scenario: Car - Two consecutive oneways" [1].
Here is content of the file (w/ timestamp attributes stripped):
<?xml version="1.0" encoding="UTF-8"?>
<osm generator="osrm-test" version="0.6">
<node id="1" version="1" uid="1" user="osrm" lon="1.0" lat="1.0">
<tag k="name" v="a"/>
</node>
<node id="2" version="1" uid="1" user="osrm"
lon="1.0008990679362704" lat="1.0">
<tag k="name" v="b"/>
</node>
<node id="3" version="1" uid="1" user="osrm"
lon="1.0026972038088113" lat="1.0">
<tag k="name" v="c"/>
</node>
<way id="4" version="1" uid="1" user="osrm">
<nd ref="1"/>
<nd ref="2"/>
<tag k="highway" v="primary"/>
<tag k="oneway" v="yes"/>
<tag k="name" v="ab"/>
</way>
<way id="5" version="1" uid="1" user="osrm">
<nd ref="2"/>
<nd ref="3"/>
<tag k="highway" v="primary"/>
<tag k="oneway" v="yes"/>
<tag k="name" v="bc"/>
</way>
</osm>
I run the OSRM processing and service:
osrm-extract.exe -p C:\apps\osrm-5.5.0\profiles\car.lua
89_car_two_consecutive_oneways.osm
osrm-contract.exe 89_car_two_consecutive_oneways.osrm
osrm-routed.exe 89_car_two_consecutive_oneways.osrm
The following queries return routes, as expected:
1. ab: http://127.0.0.1:5000/route/v1/driving/1.0,1.0;1.0008990679362704,1.0
HTTP 200
2. bc: http://127.0.0.1:5000/route/v1/driving/1.0008990679362704,1.0;1.0026972038088113,1.0
HTTP 200
Now, I try backward routes:
3. ba: http://127.0.0.1:5000/route/v1/driving/1.0008990679362704,1.0;1.0,1.0
-> HTTP 400: {'message': 'Impossible route between points', 'code': 'NoRoute'}
4. cb: http://127.0.0.1:5000/route/v1/driving/1.0026972038088113,1.0;1.0008990679362704,1.0?steps=true&geometries=geojson
-> HTTP 400: {'message': 'No route found between points', 'code': 'NoRoute'}
Why the 4th query is responded with 'No route found between points'
instead of 'Impossible route between points'?
I suspect, the way `cb` is treated differently than `ba` during processing.
If it is, what makes the difference?
[1] https://github.com/Project-OSRM/osrm-backend/blob/master/features/car/oneway.feature
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
More information about the OSRM-talk
mailing list