Discussion:
[mkgmap-dev] [Patch v0] fix sharp angles to optimise bicycle routing
Gerd Petermann
2015-08-23 07:29:37 UTC
Permalink
Hi all,

attached is a first working version of the patch, please test it with your style.

I've also uploaded a binary:
http://files.mkgmap.org.uk/download/277/mkgmap.jar

It implements two new options:
--x-fix-sharp-angles
(I plan to remove this option when the code is ready, I now think
the fixing should always be enabled)

Is needed to activate the new code.
--x-cycle-map
Should be used when the map is only usable for cycling and
walking, means, all vehicles (except foot) are treated like bicycles.
(like with styles from Minko or Felix)

The patch also removes the code for the option --adjust-turn-headings.

The important code is in a new class AngleChecker, when you want to see what
it does you should enable logging on info level like this:
uk.me.parabola.imgfmt.app.net.AngleChecker.level=INFO

When you find a message like
... sharp angle 28° at 38.343434,-0.770673 headings 40° 68° speeds 2 2 dest nodes 311 2103
followed by
... sharp angle 28° at 38.343434,-0.770673 changing arc with heading 68° -> 85° angle is now 45°
you may want to compare the routing results for that location,
once with and once without the option.
(In Basecamp and Mapsource you can use Ctrl+T to jump to the location
printed in the msg)

While testing the code I found one problem in OSM data:
Sometimes roads are duplicated, means, one road (or a part of it)
hides the other. I consider this as a potential error in the OSM data,
so a warning like this is produced:
WARN: uk.me.parabola.imgfmt.app.net.AngleChecker 63240007.o5m: sharp angle < 1° at 38.355308,-0.483420 ,maybe duplicated OSM way with bearing 359°
The message doesn't contain any OSM Id because often the
available Ids are missleading due to the merging of roads.
I use JOSM to fix these errors:
Use Ctrl+J to jump to the given position (38.355308,-0.483420) and
download a small area around the point. Next, use Alt+left mouse click
multiple times on the node to see the connected roads.

Gerd
Minko
2015-08-23 13:07:44 UTC
Permalink
Thanks Gerd, I have tested only a small bit but it looks promising.
It now routes via very sharp corners like this link:
https://graphhopper.com/maps/?point=52.194495%2C5.432616&point=52.191588%2C5.43437&point=52.192893%2C5.434665&vehicle=bike&locale=nl&elevation=true&layer=OpenStreetMap
With the regular mkgmap it makes a bigger detour.
Mike Baggaley
2015-08-24 07:10:21 UTC
Permalink
Hi Gerd, can you explain where this needs to be specified (and ideally put
something describing logging in the help page)?



Thanks,

Mike



>when you want to see what
>it does you should enable logging on info level like this:
>uk.me.parabola.imgfmt.app.net.AngleChecker.level=INFO
Gerd Petermann
2015-08-24 07:17:33 UTC
Permalink
Hi Mike,

see

http://wiki.openstreetmap.org/wiki/Mkgmap/dev#Enabling_Debugging

Don't know how to put the content into the help, but maybe it would be sufficient to add
the link?

Gerd



From: ***@tvage.co.uk
To: mkgmap-***@lists.mkgmap.org.uk
Date: Mon, 24 Aug 2015 08:10:21 +0100
Subject: Re: [mkgmap-dev] [Patch v0] fix sharp angles to optimise bicycle routing

Hi Gerd, can you explain where this needs to be specified (and ideally put something describing logging in the help page)? Thanks,Mike >when you want to see what
>it does you should enable logging on info level like this:
>uk.me.parabola.imgfmt.app.net.AngleChecker.level=INFO
Loading...