logo separator

[mkgmap-dev] [Patch v2] improve roundabout checks

From Gerd Petermann GPetermann_muenchen at hotmail.com on Mon Aug 8 06:15:20 BST 2016

Hi Mike,

looks good to me. Just one point:

Tests against bit flags should not use if (a & b > 0) , better use (a & b != 0). The same for (a + b+ c) , bettr use (a | b | c).

The integer value for for flag emergency is -128.

See modified version of the patch , I've also compiled a binary with it:


I did not understand this comment:

//ignore highways that do not meet with a road

BTW: The styles which add multiple routable ways for one OSM way will probably never use

--check-roundabouts, and I assume that Garmin software will never show reasonable exit counts for those styles

@Minko: Maybe this could explain  the crashes when routing near roundabouts with your style?


Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Mike Baggaley <mike at tvage.co.uk>
Gesendet: Sonntag, 7. August 2016 22:41:45
An: 'Development list for mkgmap'
Betreff: Re: [mkgmap-dev] [Patch v2] improve roundabout checks

Hi Gerd, please find attached a version 3 patch, that seems to me to provide everything we need at the moment. It provides two warning messages  of forms “Roundabout is connected to more than one road at…” and “Roundabout is connected to a road and other highways at…”. It does not warn for multiple highways where there is no road with car access (e.g. a cycleway that goes straight across a roundabout). Please commit if everyone is happy.


From: Mike Baggaley [mailto:mike at tvage.co.uk]
Sent: 05 August 2016 08:22
To: 'Development list for mkgmap' <mkgmap-dev at lists.mkgmap.org.uk>
Subject: RE: [mkgmap-dev] [Patch v2] improve roundabout checks

HI Gerd, the rationale behind choosing car in determining whether a way is an exit was that I was expecting most people when counting exits would only include exits that are normal roads. If we include cycleways in the test, we run the danger of false positives where a cycleway runs alongside a road and ends at the roundabout. I don’t think it is possible to get an absolutely perfect solution. For me, Incorrect exit hints is the prime target – though it is not clear what we should do if the optimum layout for Garmin does not follow OSM rules. It is perhaps questionable what should happen when a cycleway meets a roundabout, so it seems more reasonable to not flag these up. We could count ways with cycling access but no car access separately and flag a slightly different warning to distinguish them. Or we could count ways with no car access but  access to other vehicles or cycles. My prime target would be to separate those that can be easily corrected from those that are questionable, so I can attempt to reduce the former to zero without having to evaluate all the questionable ones.


From: Gerd Petermann [mailto:GPetermann_muenchen at hotmail.com]
Sent: 05 August 2016 05:53
To: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk<mailto:mkgmap-dev at lists.mkgmap.org.uk>>
Subject: Re: [mkgmap-dev] [Patch v2] improve roundabout checks

Hi Mike,

as a cyclist I wonder why you treat cars that special. From the previous post I thought that we

may ignore pedestrian-only ways.

Besides that some style authors use "car routing" to distinguish between racing bikes and

normal bikes. Not sure if that can cause problems here.

I am unsure if we want to flag ways which are wrong reg. OSM rules or if we try to find

roundabouts were the Garmin algo will produce false exit hints.


Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk<mailto:mkgmap-dev-bounces at lists.mkgmap.org.uk>> im Auftrag von Mike Baggaley <mike at tvage.co.uk<mailto:mike at tvage.co.uk>>
Gesendet: Donnerstag, 4. August 2016 23:40:38
An: mkgmap-dev at lists.mkgmap.org.uk<mailto:mkgmap-dev at lists.mkgmap.org.uk>
Betreff: Re: [mkgmap-dev] [Patch v2] improve roundabout checks

HI Gerd, that looks like a good start. The attached patch improves on it slightly by ignoring highways that do not have access for cars.


From: Gerd Petermann [mailto:GPetermann_muenchen at hotmail.com]
Sent: 03 August 2016 14:40
To: mkgmap-dev at lists.mkgmap.org.uk<mailto:mkgmap-dev at lists.mkgmap.org.uk>
Subject: [mkgmap-dev] [Patch v1] improve roundabout checks

Hi all,

attached is a patch for the roundabout checks. It adds a test that will warn when

a node on a roundabout is connected to more than one routable way

(ways which are not accessable are not counted, e.g. highway=construction with the default style)

The check is only performed when option
--check-roundabouts is used, you have  to enable logging to see the result.
The check is implemented in class RouteNode, so a config line in logging.properties might be

A binary based on r3688 is here:


Note that this check is very basic, it doesn't ignore when the road is going straight through the roundabout

or when it builds a tagent. If you think that this produces too many false warning I may add

code for this.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20160808/2c11541c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_roundabout_connections_v4.patch
Type: application/x-download
Size: 2324 bytes
Desc: check_roundabout_connections_v4.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20160808/2c11541c/attachment-0001.bin>

More information about the mkgmap-dev mailing list