Commit: r806: Off by one error is determining if a point is a node or not.

Version 806 was commited by steve on 2008-12-10 19:39:21 +0000 (Wed, 10 Dec 2008) Off by one error is determining if a point is a node or not. Set internal nodes determination temporarily set to n>2.

Robert
Version 806 was commited by steve on 2008-12-10 19:39:21 +0000 (Wed, 10 Dec 2008)
Off by one error is determining if a point is a node or not.
Set internal nodes determination temporarily set to n>2.
With these changes I get perfect routing on my smallish test map. I can route right out to the edge of the map. If it can't get somewhere it just draws a straight line instead of an error dialog. But you should probably take a look at calculating the internal node boolean as I'm not sure what you intended here. ..Steve

On Dec 10, 2008, at 20:44, Steve Ratcliffe wrote:
Version 806 was commited by steve on 2008-12-10 19:39:21 +0000 (Wed, 10 Dec 2008)
Off by one error is determining if a point is a node or not.
Set internal nodes determination temporarily set to n>2.
With these changes I get perfect routing on my smallish test map. I can route right out to the edge of the map. If it can't get somewhere it just draws a straight line instead of an error dialog.
Great! Thanks for finding that extra bit bug, and sorry for introducing it.
But you should probably take a look at calculating the internal node boolean as I'm not sure what you intended here.
What I tried to implement is this: Write extra bits only if the road has nodes beside the start and end node. On the assumption that start and end points are always nodes, this should be equivalent to nodes.size()>2, but I've also seen .mp- files where the starting or end point were not routing nodes. Does the change to RoadHelper actually do anything for your sample? What I saw in sample maps (and also what Alex said, perhaps, I think), is that the extra bit is set only if there are such internal nodes (in the road, not in the segment). Furthermore, it appears to be set if the corresponding point is a node and an internal point of the road (and not the first point of a segment). Cheers Robert

Write extra bits only if the road has nodes beside the start and end node. On the assumption that start and end points are always nodes, this should be equivalent to nodes.size()>2, but I've also seen .mp-files where the starting or end point were not routing nodes.
OK I'll change the test to n < points.size() - 1 then.
Does the change to RoadHelper actually do anything for your sample?
Yes it did, as there were only three nodes on the road but the first four points were not nodes and so the test against nodes.size() wasn't true. I think the reason that osm2mp used to give worse results was that it joins roads together if they are the same type and name. This gives more opertunity for the bugs to show as the ways in OSM are often quite short and end at junctions even when the road doesn't change. Cheers, ..Steve

On Dec 10, 2008, at 22:33, Steve Ratcliffe wrote:
Write extra bits only if the road has nodes beside the start and end node. On the assumption that start and end points are always nodes, this should be equivalent to nodes.size()>2, but I've also seen .mp-files where the starting or end point were not routing nodes.
OK I'll change the test to n < points.size() - 1 then.
Finally, I see the bug :) Took a while, too. Cheers Robert
participants (3)
-
Robert Vollmert
-
Steve Ratcliffe
-
svn commit