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