[mkgmap-dev] special cases in restriction relations, r3178 still not perfect
From Gerd Petermann gpetermann_muenchen at hotmail.com on Fri Apr 11 15:23:34 BST 2014
Hi Andrzej, > > I haven't browse your code for restriction, but I get the feeling, that > it is complicated :) yes, the code is complex :-( Besides my own limitations there are several reasons: 1) Turn restrictions in OSM give ways and maybe a via node, they are identified by OSM ids. 2) In mkgmap we exchange the ids by "pointers" to the way or node objects, and the ids of the nodes are normally not kept. 3) A lot of routines are manipulating these objects, e.g. points are added or removed, roads are merged or split, simple node objects are replaced by CoordNode instances. Everywhere we must make sure that we update the restrictions that refer to the objects. This is complex and error-prone. 4) After the road network is created, the restrictions are added. This is the first time that mkgmap "knows" all the ways that meet at a via node. Here we have to translate the meaning of the OSM restriction to the Garmin format, which requires a sequence of nodes and arcs between them that describes the forbidden way. While writing this I think that I really should move most of the logic to this place, although it is not needed when the source is polish format. Up to now some checks are performed earlier, the only good reason for that is that we can detect some invalid restriction relations earlier and therefore allow WrongAngleFixer and RoadMerger to ignore the via nodes. I'll think about this again. > > > I'd prefer to change the wiki and say that this case must be avoided. > > It won't be easy to define this case for a common mapper. > > What condition is triggered in your code? A loop? Repeated node? Or > maybe multiple ways fitting as via for restriction? The problem is that the to-way is a loop, both start and end point are connected to the from way. The current code tries to find the next routing node on the to-way, but was is next if you can start at both ends? The wiki should say that the from and to way must either start or end at the via node/way. The current text says only : The "from" and "to" members must start/end at the "via" node, otherwise split it! Or maybe "start/end" already means "either start or end, not both" ? Gerd -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140411/1206c926/attachment.html>
- Previous message: [mkgmap-dev] special cases in restriction relations, r3178 still not perfect
- Next message: [mkgmap-dev] special cases in restriction relations, r3178 still not perfect
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list