logo separator

[mkgmap-dev] mkgmap routing bug

From ddyeti2000-mkgmap at yahoo.de ddyeti2000-mkgmap at yahoo.de on Wed Oct 13 11:10:43 BST 2010

Hi,

I found a bug in mkgmap if one use turn restrictions for routing in combination with the make-cycleway option.
As far as I understand the make-cycleway options duplicates ways with a bicycle lane etc. The new way seems to use the same nodes as the original way. If you have a node with turn restrictions (via node), this operation would add one ore more additional ways to this node, that may share the same toNode and fromNode but no or wrong restriction reference. Therefore, it could be that the fromNode or toNode is added as OtherNode in StyledConverter.java (line 1616 and 1636).
I think the easiest hot fix is to prevent to add the fromNode and toNode to the restriction, RestrictionRelation.java -> addRestriction(MapCollector collector) in the only_* condition branch (line 293).

I have tested the attached patch. It works fine. I don't think, that this patch breaks any mkgmap function, because:
1) It avoids adding a from/toNode to a restriction of a only_* condition.
2) Adding other nodes several times to a restriction.
This is obviously a wanted behavior.

Another solution would be to flag generated ways (from make-cycleways) and to not consider in any turn restriction, because they have no or wrong turn restrictions. But this is a more invasive change.

DDYeti

-------------- next part --------------
A non-text attachment was scrubbed...
Name: RestrictionRelation.patch
Type: application/octet-stream
Size: 1330 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20101013/9df62b45/attachment.obj 


More information about the mkgmap-dev mailing list