
Hi all, I've coded a new algo to detect and remove sharp angles in roundabouts caused by rounding coordinates to map units. There are many special cases, but I think it works quite well now. Please test mkgmap-high-prec-coord-r2819 . I found two typical problems: 1) Small roundabouts (radius < 10m) mapped with (too) many points, this gives ways like in 157324858_o.gpx 2) Large roundabouts (radius > 16m) mapped with too few points. Note that some of these problems cause routing problems in the trunk version but not in the branch. I've left a lot of debugging messages in the code, so you should write the sysout to a file (I'll change the code to use the logging system later) I have also left an option --x-gpx-dir=<dir-for-gpx-files> to create gpx files showing the ways in various stages. Note that this option produces many small files, so use it only with one or a few input files. The gpx files have a name scheme: [way-id]_o.gpx: original way, once with high precision coordinates, once with the rounded values [way-id]_del1_[n]_[pass].gpx: way before a remove-point-action [way-id]_del2_[n]_[pass].gpx: way after a remove-point-action [way-id]_m.gpx: final roundabout, once with high precision coordinates, once with the rounded values, plus map unit grid You should not find many of these: [way-id]_repl_o_[pass].gpx, id]_repl_n_[pass].gpx way that is connected to a roundabout, and the move of the node causes a notable change in the angle near the roundabout. I found no case where this lead to uglyer angles, typically, the changed way was closer to the one in OSM . Open question: The algo doesn't add points to make a roundabout rounder. It just complains like this: Way http://www.openstreetmap.org/browse/way/136791460: roundabout has rather few distinct points: 9 (radius ~ 17 m) Way http://www.openstreetmap.org/browse/way/136791476: roundabout has rather few distinct points: 8 (radius ~ 20 m) Both examples also show why adding points is not a good idea. The rule for these messages : if (radius < 10.0) niceNumSides = 8; else if (radius < 13.0) niceNumSides = 12; else if (radius < 20.0) niceNumSides = 16; else niceNumSides = 20; if (points.size() < niceNumSides){ if (points.size() < 16) System.out.println(msgPref + ": roundabout has rather few distinct points: " + points.size() + " (radius ~ "+Math.round(radius)+" m)"); niceNumSides = points.size(); } Are these rules okay? Are the messages helpful? Gerd

Hi all, sorry, I've just noticed that r2819 was based on an out-aged trunk version (2800). Please use r2821 instead, which is based on r2815. I am now working on a similar algo for normal roads. Gerd From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Date: Mon, 11 Nov 2013 11:14:26 +0100 Subject: [mkgmap-dev] nicer roundabouts Hi all, I've coded a new algo to detect and remove sharp angles in roundabouts caused by rounding coordinates to map units. There are many special cases, but I think it works quite well now. Please test mkgmap-high-prec-coord-r2819 . I found two typical problems: 1) Small roundabouts (radius < 10m) mapped with (too) many points, this gives ways like in 157324858_o.gpx 2) Large roundabouts (radius > 16m) mapped with too few points. Note that some of these problems cause routing problems in the trunk version but not in the branch. I've left a lot of debugging messages in the code, so you should write the sysout to a file (I'll change the code to use the logging system later) I have also left an option --x-gpx-dir=<dir-for-gpx-files> to create gpx files showing the ways in various stages. Note that this option produces many small files, so use it only with one or a few input files. The gpx files have a name scheme: [way-id]_o.gpx: original way, once with high precision coordinates, once with the rounded values [way-id]_del1_[n]_[pass].gpx: way before a remove-point-action [way-id]_del2_[n]_[pass].gpx: way after a remove-point-action [way-id]_m.gpx: final roundabout, once with high precision coordinates, once with the rounded values, plus map unit grid You should not find many of these: [way-id]_repl_o_[pass].gpx, id]_repl_n_[pass].gpx way that is connected to a roundabout, and the move of the node causes a notable change in the angle near the roundabout. I found no case where this lead to uglyer angles, typically, the changed way was closer to the one in OSM . Open question: The algo doesn't add points to make a roundabout rounder. It just complains like this: Way http://www.openstreetmap.org/browse/way/136791460: roundabout has rather few distinct points: 9 (radius ~ 17 m) Way http://www.openstreetmap.org/browse/way/136791476: roundabout has rather few distinct points: 8 (radius ~ 20 m) Both examples also show why adding points is not a good idea. The rule for these messages : if (radius < 10.0) niceNumSides = 8; else if (radius < 13.0) niceNumSides = 12; else if (radius < 20.0) niceNumSides = 16; else niceNumSides = 20; if (points.size() < niceNumSides){ if (points.size() < 16) System.out.println(msgPref + ": roundabout has rather few distinct points: " + points.size() + " (radius ~ "+Math.round(radius)+" m)"); niceNumSides = points.size(); } Are these rules okay? Are the messages helpful? Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@www.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Nice job Gerd! But sometimes I see that the road network is broken, for instance on this cycleway roundabout (not a circle, but your patch made a circle from it, and some connections got broken): http://www.openstreetmap.org/browse/way/82763960 https://www.dropbox.com/s/s2ddm67y91j72p9/roundabout.jpg

Hi Minko, thanks for reporting this. I'll have a look at it tomorrow. Gerd Minko-2 wrote
Nice job Gerd! But sometimes I see that the road network is broken, for instance on this cycleway roundabout (not a circle, but your patch made a circle from it, and some connections got broken):
http://www.openstreetmap.org/browse/way/82763960 https://www.dropbox.com/s/s2ddm67y91j72p9/roundabout.jpg _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/nicer-roundabouts-tp5784943p5785298.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Minko, the problem is fixed with r2823. Gerd Minko-2 wrote
Nice job Gerd! But sometimes I see that the road network is broken, for instance on this cycleway roundabout (not a circle, but your patch made a circle from it, and some connections got broken):
http://www.openstreetmap.org/browse/way/82763960 https://www.dropbox.com/s/s2ddm67y91j72p9/roundabout.jpg _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/nicer-roundabouts-tp5784943p5785372.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Thanks Gerd, With version 2823 this cycleway becomes unroutable http://www.openstreetmap.org/browse/way/68132358 (looks there is no connection with the roundabout) In the log file there is a warning, replacement introduces big change in bearing. Another case of broken routing http://www.openstreetmap.org/browse/way/76650175 Both roundabouts look better though, but I think we prefer better routing above cosmetics ;-) I didnt check all other warnings, just a few.

Hi Minko, I can't reproduce the problem. Please press two times Ctrl+G to make sure that the MapSource cache is cleared. Does that help? Gerd
Date: Thu, 14 Nov 2013 16:36:53 +0100 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] nicer roundabouts
Thanks Gerd,
With version 2823 this cycleway becomes unroutable http://www.openstreetmap.org/browse/way/68132358 (looks there is no connection with the roundabout) In the log file there is a warning, replacement introduces big change in bearing.
Another case of broken routing http://www.openstreetmap.org/browse/way/76650175
Both roundabouts look better though, but I think we prefer better routing above cosmetics ;-)
I didnt check all other warnings, just a few. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Nope, does not help. I also tried the default style but the roundabout is still broken. Here is a screenshot with GPSmapedit, it shows that the end node of way 76650175 is not connected to the roundabout anymore: https://www.dropbox.com/s/0c6daru3mab2f86/roundabout.jpg http://www.openstreetmap.org/browse/way/76650175
Hi Minko,
I can't reproduce the problem. Please press two times Ctrl+G to make sure that the MapSource cache is cleared. Does that help?
Gerd

Hi Minko, I looked only at the first sample. I was able to reproduce the error with way 76650175. Fixed with r2824. Gerd Minko-2 wrote
Nope, does not help. I also tried the default style but the roundabout is still broken.
Here is a screenshot with GPSmapedit, it shows that the end node of way 76650175 is not connected to the roundabout anymore:
https://www.dropbox.com/s/0c6daru3mab2f86/roundabout.jpg http://www.openstreetmap.org/browse/way/76650175
Hi Minko,
I can't reproduce the problem. Please press two times Ctrl+G to make sure that the MapSource cache is cleared. Does that help?
Gerd
mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/nicer-roundabouts-tp5784943p5785493.html Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (3)
-
Gerd Petermann
-
GerdP
-
Minko