logo separator

[mkgmap-dev] nicer roundabouts

From Gerd Petermann gpetermann_muenchen at hotmail.com on Mon Nov 11 10:14:26 GMT 2013

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
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20131111/994d714e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 157324858_o.gpx
Type: application/octet-stream
Size: 2365 bytes
Desc: not available
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20131111/994d714e/attachment.obj>


More information about the mkgmap-dev mailing list