Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wild routing oddity #4221

Closed
joovel opened this issue Jun 30, 2017 · 4 comments
Closed

Wild routing oddity #4221

joovel opened this issue Jun 30, 2017 · 4 comments

Comments

@joovel
Copy link

joovel commented Jun 30, 2017

Here's a brief script to capture this odd result I'm getting from a routing:

mkdir -p data/osrm
pushd data/osrm
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/los-angeles_california.osm.pbf
popd
docker run --tty --volume `pwd`/data/osrm:/data osrm/osrm-backend:v5.8.0 osrm-extract -p /opt/foot.lua /data/los-angeles_california.osm.pbf
docker run --tty --volume `pwd`/data/osrm:/data osrm/osrm-backend:v5.8.0 osrm-contract /data/los-angeles_california.osrm
docker run --detach -v `pwd`/data/osrm:/data -p 45000:5000 osrm/osrm-backend:v5.8.0 osrm-routed /data/los-angeles_california.osrm

Then I issue this curl:

curl 'http://localhost:45000/route/v1/walking/-117.70203,33.46642;-117.691793,33.460241'

The result is a crazy route taking the user over two ferries (I think) and then back down the PCH. The polyline shows the rough route.

{
  "code": "Ok",
  "routes": [
    {
      "geometry": "klgkEvtkmUj@|p@yxMdiMq_BxvEalFbcIy_BzuAwzAboKg{DjeIe_DlrEa}IppIor@vhBolAhh@ev@nkNre@fz@v`BcuCr|@RxkBp`AbzgAjsYoySudzBav@_@",
      "legs": [
        {
          "steps": [],
          "distance": 172320.3,
          "duration": 53331.8,
          "summary": "",
          "weight": 53331.8
        }
      ],
      "distance": 172320.3,
      "duration": 53331.8,
      "weight_name": "duration",
      "weight": 53331.8
    }
  ],
  "waypoints": [
    {
      "hint": "JNEJgB02F4CCAAAAfwAAAAAAAABHAQAAggAAAH8AAAAAAAAARwEAAAEAAABnAvz4Xqj-AXIC_Pg0qP4BAAAPAEFVQIU=",
      "name": "Pacific Coast Highway",
      "location": [
        -117.702041,
        33.466462
      ]
    },
    {
      "hint": "HJYOgB-WDoBYAAAAfgAAAP8BAAAAAAAAWAAAAH4AAAD_AQAAAAAAAAEAAAAJK_z47o_-AW8q_PgRkP4BBgAPAEFVQIU=",
      "name": "",
      "location": [
        -117.691639,
        33.460206
      ]
    }
  ]
}

The two points are only 1.5km apart.

When I run this on openstreetmap.org (http://www.openstreetmap.org/directions?engine=mapzen_foot&route=33.4662%2C-117.7025%3B33.4602%2C-117.6918#map=17/33.46324/-117.69720) using "Foot (MapZen)", I get realistic directions.

I expect to get similar realistic directions from OSRM.

We first experienced this issue with 5.6.0 and 5.6.5.

@oxidase
Copy link
Contributor

oxidase commented Jun 30, 2017

@joovel it is an effect of OSRM snapping behavior (the route end point is a projection onto the nearest segment) and a data issue (https://www.openstreetmap.org/way/46788688#map=10/33.4023/-118.0062 is not connected to any footway). "Foot (MapZen)" also provides an unrealistic route for slightly shifted edpoint
https://www.openstreetmap.org/directions?engine=mapzen_foot&route=33.46620%2C-117.70250%3B33.46009%2C-117.69174#map=10/33.5562/-118.0062

@joovel
Copy link
Author

joovel commented Jun 30, 2017

@oxidase Thanks for the quick and detailed analysis! Will someone fix the OSM data, or is that on me? Also, is there a way to tell OSRM to do a fuzzier search for a footway?

@oxidase
Copy link
Contributor

oxidase commented Jun 30, 2017

data issues usually fixed by local OSM communities. OSRM demo server http://map.project-osrm.org/?z=14&center=33.468144%2C-117.670956&hl=en&alt=0 has "Small Components" layer that highlights unconnected or partially connected ways.

Without OSM changes ferries can be disabled as a quick fix by removing handle_ferries.
Also #4006 is in progress and will allow avoiding ferries in query time.

@joovel
Copy link
Author

joovel commented Jun 30, 2017

@oxidase : Thanks. I've sketched in a few sidewalks that should be more helpful. Thanks for adding the pointer to handle_ferries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants