Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.35k stars 3.36k forks source link

map matching car on cycleways #5176

Closed donnut closed 6 years ago

donnut commented 6 years ago

We are using the car.lua profile and try to map match a gps trace using the following call:

http://localhost:5000/match/v1/driving/5.124148368835449,52.08147048950195;5.12421178817749,52.08137893676758;5.12422513961792,52.08134841918945;5.1242265701293945,52.08131790161133;5.124196529388428,52.08121871948242;5.124129772186279,52.081119537353516;5.124011516571045,52.081024169921875;5.123970031738281,52.08101272583008;5.123908519744873,52.08100128173828;5.123885154724121,52.08100128173828;5.123796463012695,52.081016540527344;5.123533248901367,52.0810432434082;5.123293399810791,52.08102798461914;5.123176574707031,52.08100509643555;5.123058319091797,52.08096694946289;5.122823238372803,52.08088302612305;5.122714996337891,52.080841064453125;5.122513294219971,52.08074951171875;5.122426509857178,52.08071517944336;5.122276782989502,52.080650329589844;5.1222100257873535,52.080623626708984;5.122153282165527,52.08059310913086;5.122045040130615,52.08053970336914;5.122010231018066,52.080528259277344;5.121996879577637,52.08052444458008;5.1219282150268555,52.08049774169922;5.121728420257568,52.080360412597656;5.1216535568237305,52.080299377441406;5.121496677398682,52.08015823364258;5.121333122253418,52.080013275146484;5.12107515335083,52.07978057861328;5.120838165283203,52.07954406738281;5.120688438415527,52.07939529418945;5.120619773864746,52.07932662963867;5.120498180389404,52.07920837402344;5.120431900024414,52.079158782958984;5.1203765869140625,52.07912063598633;5.12028169631958,52.07906723022461;5.120275020599365,52.07910919189453;5.120253562927246,52.0790901184082;5.120144844055176,52.07899856567383;5.120045185089111,52.0789794921875;5.119894981384277,52.07902145385742;5.119718551635742,52.0790901184082?steps=true&overview=full&annotations=true&geometries=geojson&gaps=ignore&tidy=false&radiuses=20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20;20&timestamps=1514794935;1514794937;1514794938;1514794939;1514794941;1514794943;1514794946;1514794947;1514794949;1514794950;1514794952;1514794955;1514794957;1514794958;1514794959;1514794961;1514794962;1514794964;1514794965;1514794967;1514794968;1514794969;1514794972;1514794975;1514794976;1514794978;1514794981;1514794982;1514794984;1514794986;1514794989;1514794992;1514794994;1514794995;1514794997;1514794998;1514794999;1514795001;1514795017;1514795018;1514795021;1514795023;1514795025;1514795027

The result is shown in the graph below:

screenshot from 2018-08-22 14-58-13

The red circles are the gps trace (used to construct the api call above) and the orange circles show the tracepoints that are the result from the mapping. You notice the gap in the tracepoints on the Catharijnesingel. The confidence level of this mapping is 0.0.

We investigate the reason why it doesn't map this particular part of the road. We noticed it as tags cycleway: lane and width: 1.5m. The vehicle width defined in car.lua is 1.9m, but it is allowed to drive on the cycleway. Is this indeed the reason it isn't mapping? Is this type of road correctly tagged? Can you advice us what to change in the profile so it maps this road correctly? Is modifying the profile the best approach?

danpat commented 6 years ago

The problem are these two ways:

https://www.openstreetmap.org/way/93710730 https://www.openstreetmap.org/way/93710727

Both of these have access=no on them, and no other permissive vehicle tag, which means they're closed for cars as far as OSRM is concerned. This is causing a disconnect when trying to follow your GPS trace - without these roads, the only way to go north-east to south-west like the trace says, is to take a long detour around this intersection. This is the cause of the gap in matching.

You can see this if you use the "debug viewer" from https://github.com/Project-OSRM/osrm-frontend/tree/gh-pages/debug - there are no routable edges for the two ways above:

screen shot 2018-08-22 at 8 15 04 am

(on this map, coloured lines indicate things that OSRM knows about and can route on. The grey background is the OSM data).

If you did actually drive this, then I suspect it's an OSM tagging error.

donnut commented 6 years ago

Thanks for diving into this and for reminding me of the frontend debug option. To bad the public version it isn't working at the moment, see https://github.com/Project-OSRM/osrm-frontend/issues/287