itinero / routing

The routing core of itinero.
Apache License 2.0
221 stars 69 forks source link

Too much Instructions #199

Open TomQv opened 6 years ago

TomQv commented 6 years ago

Please check the following route, only 7km, in the area north east of Giessen, Germany. Supposed to be only 3 turn-offs, but we have lots of unnecessary instructions and one important instructions is even missing. How can we start getting these things better?

Here is the route: too_much_instructions.zip

And the instructions:

0,00km 0s Start east.
0,08km 13s Go slightlyleft.
0,33km 52s Go right.
0,34km 53s Go left.
0,58km 1m5s Go straighton.
0,79km 1m15s Go straighton.
0,98km 1m25s Go straighton.
1,9km 2m13s Go straighton on Untergasse.
2,1km 2m29s Go slightlyleft on Untergasse.
2,2km 2m41s Go slightlyright on Untergasse.
2,3km 2m49s Go slightlyleft on Untergasse.
2,4km 2m56s Go slightlyright on Untergasse.
2,5km 3m22s Go slightlyleft on Untergasse.
2,6km 3m36s Go slightlyleft on Fünfhausen.
2,7km 3m42s Go slightlyleft on Fünfhausen.
3,0km 4m20s Go left on Fünfhausen.
3,1km 4m22s Go slightlyright on Fünfhausen.
3,9km 5m12s Go straighton.
5,2km 6m16s Go left.
5,3km 6m19s Go left.
5,5km 6m28s Go straighton.
6,9km 7m38s Go right.
6,9km 7m39s Go straighton.
jerryfaust commented 6 years ago

Hello @TomQv

If you are interested, you can look at my fork of Itinero 'master' (https://github.com/jerryfaust/routing) in which, among other changes, I have attempted to simplify the instructions in two ways:

  1. I have tried to correct for what I consider mislabeled turns - for example, those that indicate a right turn when intuitively it would be considered straight-on or slightly-right, and
  2. I have tried to minimize repeated 'Continue on' instructions when you are just continuing on the same street.

I generally work with Shapefile networks, so I have a custom Lua file, but I have also modified the OSM car.lua with the same changes (although I have not tested it).

Note that you need the updates to the DirectionCalculator as well as the Lua file to get the full benefit of the streamlined instructions.

Within the fork, look at the changes committed under the name "Enhanced Directions calculation...". Only three files are affected. You can either take the whole fork and build it, or just try integrating the 3 files into your build.

Best Regards, Jerry

TomQv commented 5 years ago

Hi Jerry, sorry for late answer, was out of office. Will give your solution a try the next days. Thank you, Tom