Patch for routing problems in r2448 and higher

Hi, with r2448 the removeShortArcs routine was no longer applied to non-routable ways. This increased the possibility that an invalid line passes all filters but finally is not written to the RGN file while still increasing the subdivision lineNumber. This breaks routing in some case. Attached patch adds a check to the final filter to avoid that. fix_routing_v1.patch <http://gis.19327.n5.nabble.com/file/n5747979/fix_routing_v1.patch> @Steve: It would also be possible to create a new filter for that, but this would mean that we duplicate most of the code in LinePreparer. I don't know if this would be better. Ciao, Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi, forgot to mention that this patch can be applied to trunk r2448 and higher... Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Is remove_short_arcs v4.patch also needed? Because the Fix Routing_patch_v1 doesn't fully solve it for me. Now I can route along that previously broken stretch of road. But I still cannot route from it to another road. Or route from it to somewhere else. Also there seems to be a huge bug about relations now. They appear all over the place now! So beware, this patch is not suitable for productive use! On 04.02.2013 10:45, GerdP wrote:
Hi,
with r2448 the removeShortArcs routine was no longer applied to non-routable ways. This increased the possibility that an invalid line passes all filters but finally is not written to the RGN file while still increasing the subdivision lineNumber. This breaks routing in some case.
Attached patch adds a check to the final filter to avoid that.
fix_routing_v1.patch <http://gis.19327.n5.nabble.com/file/n5747979/fix_routing_v1.patch>
@Steve: It would also be possible to create a new filter for that, but this would mean that we duplicate most of the code in LinePreparer. I don't know if this would be better.
Ciao, Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Felix Hartmann-2 wrote
Is remove_short_arcs v4.patch also needed?
no, remove_short_arcs v4.patch is a work around for the error that this patch should correct. Felix Hartmann-2 wrote
Because the Fix Routing_patch_v1 doesn't fully solve it for me. Now I can route along that previously broken stretch of road. But I still cannot route from it to another road. Or route from it to somewhere else.
Also there seems to be a huge bug about relations now. They appear all over the place now! So beware, this patch is not suitable for productive use!
What exctly do you mean? I can't see how this patch should change something related to relations. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Actually you're right. It's not the relations that get crazy, but any line created by continue command - see the following screenshot: http://openmtbmap.org/broken_continue.jpg The semitransparent/dotted zickzack black lines, should be aligned to roads. In the top center (at the big intersection) the arrows should be oneway arrows alingned to to the roundabout... On 04.02.2013 11:58, GerdP wrote:
Felix Hartmann-2 wrote
Is remove_short_arcs v4.patch also needed? no, remove_short_arcs v4.patch is a work around for the error that this patch should correct.
Felix Hartmann-2 wrote
Because the Fix Routing_patch_v1 doesn't fully solve it for me. Now I can route along that previously broken stretch of road. But I still cannot route from it to another road. Or route from it to somewhere else.
Also there seems to be a huge bug about relations now. They appear all over the place now! So beware, this patch is not suitable for productive use! What exctly do you mean? I can't see how this patch should change something related to relations.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Hi Felix, just to make sure: You firstuse a trunk version to create the map and you don't see these errors (but you have routing problems) Then you apply the patch and create the map and you see these errors? Gerd Felix Hartmann-2 wrote
Actually you're right. It's not the relations that get crazy, but any line created by continue command - see the following screenshot: http://openmtbmap.org/broken_continue.jpg
The semitransparent/dotted zickzack black lines, should be aligned to roads. In the top center (at the big intersection) the arrows should be oneway arrows alingned to to the roundabout...
On 04.02.2013 11:58, GerdP wrote:
Felix Hartmann-2 wrote
Is remove_short_arcs v4.patch also needed? no, remove_short_arcs v4.patch is a work around for the error that this patch should correct.
Felix Hartmann-2 wrote
Because the Fix Routing_patch_v1 doesn't fully solve it for me. Now I can route along that previously broken stretch of road. But I still cannot route from it to another road. Or route from it to somewhere else.
Also there seems to be a huge bug about relations now. They appear all over the place now! So beware, this patch is not suitable for productive use! What exctly do you mean? I can't see how this patch should change something related to relations.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- keep on biking and discovering new trails
Felix openmtbmap.org & www.velomap.org
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Yes, current trunk is fine - except the routing errors. Once I use the patch, most of the ways created using continue command go crazy (maybe all?). Actually using the patch, nothing works at all anymore. Routing is broken all over the place. I do think the patch has a problem with how continue works or some other major default. Actually remove_short_arcs v4.patch solves the routing problem completely (since I removed the typo from my style-file). On 04.02.2013 13:07, GerdP wrote:
Hi Felix,
just to make sure: You firstuse a trunk version to create the map and you don't see these errors (but you have routing problems) Then you apply the patch and create the map and you see these errors?
Gerd
Felix Hartmann-2 wrote
Actually you're right. It's not the relations that get crazy, but any line created by continue command - see the following screenshot: http://openmtbmap.org/broken_continue.jpg
The semitransparent/dotted zickzack black lines, should be aligned to roads. In the top center (at the big intersection) the arrows should be oneway arrows alingned to to the roundabout...
On 04.02.2013 11:58, GerdP wrote:
Felix Hartmann-2 wrote
Is remove_short_arcs v4.patch also needed? no, remove_short_arcs v4.patch is a work around for the error that this patch should correct.
Felix Hartmann-2 wrote
Because the Fix Routing_patch_v1 doesn't fully solve it for me. Now I can route along that previously broken stretch of road. But I still cannot route from it to another road. Or route from it to somewhere else.
Also there seems to be a huge bug about relations now. They appear all over the place now! So beware, this patch is not suitable for productive use! What exctly do you mean? I can't see how this patch should change something related to relations.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- keep on biking and discovering new trails
Felix openmtbmap.org & www.velomap.org
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

here you go http://openmtbmap.org/mkgmap.jar On 04.02.2013 13:47, Minko wrote:
Felix wrote:
Actually
remove_short_arcs v4.patch
solves the routing problem completely (since I removed the typo from my style-file).
Can you put this patched mkgmap.jar somewhere online so I can test if that solves my routing issues too?
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

You could give this one a try to: http://openmtbmap.org/mkgmap_v1.jar (look for errors on continue command - which I think you use too) This is using the routing_v1 patch, which for me doesn't work at all, as everything using continue seems to break (it always breaks, what gets created by continue, so the line in front of the continue command still works, additional lines are somewhere in the map, but not where they should be). On 04.02.2013 14:04, Minko wrote:
Thanks Felix,
It solves my routing issues too!
Cheers,
Minko
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Yeah, the map turns into a total mess now, like if a bomb has exploded ;-) Not recommended :-)
You could give this one a try to:
http://openmtbmap.org/mkgmap_v1.jar (look for errors on continue command - which I think you use too)

Hi all, yes, sorry, the patch really produces garbage. I don't have a quick fix for that, so this isn't the right place to fix the problem. I will try to code a separate filter so that we can avoid calling MapBuilder.LineAddFilter.doFilter @Steve : I wonder if it is correct that LinePreparer calculates zero-deltas for coords which are not equal? Gerd Minko-2 wrote
Yeah, the map turns into a total mess now, like if a bomb has exploded ;-) Not recommended :-)
You could give this one a try to:
http://openmtbmap.org/mkgmap_v1.jar (look for errors on continue command - which I think you use too)
mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.

So what about remove_short_arcs_v4.patch - is it safe to use for now? If yes, why not commit it instead? On 04.02.2013 16:21, GerdP wrote:
Hi all,
yes, sorry, the patch really produces garbage.
I don't have a quick fix for that, so this isn't the right place to fix the problem. I will try to code a separate filter so that we can avoid calling MapBuilder.LineAddFilter.doFilter
@Steve : I wonder if it is correct that LinePreparer calculates zero-deltas for coords which are not equal?
Gerd
Minko-2 wrote
Yeah, the map turns into a total mess now, like if a bomb has exploded ;-) Not recommended :-)
You could give this one a try to:
http://openmtbmap.org/mkgmap_v1.jar (look for errors on continue command - which I think you use too)
mkgmap-dev mailing list mkgmap-dev@.org http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Hi Felix, yes, I think it is save to use, but it doesn't solve the problem in all cases, and it does too much. I should be able to create a new filter today, so I don't want to commit it now. Gerd Felix Hartmann-2 wrote
So what about remove_short_arcs_v4.patch - is it safe to use for now? If yes, why not commit it instead? On 04.02.2013 16:21, GerdP wrote:
Hi all,
yes, sorry, the patch really produces garbage.
I don't have a quick fix for that, so this isn't the right place to fix the problem. I will try to code a separate filter so that we can avoid calling MapBuilder.LineAddFilter.doFilter
@Steve : I wonder if it is correct that LinePreparer calculates zero-deltas for coords which are not equal?
Gerd
Minko-2 wrote
Yeah, the map turns into a total mess now, like if a bomb has exploded ;-) Not recommended :-)
You could give this one a try to:
http://openmtbmap.org/mkgmap_v1.jar (look for errors on continue command - which I think you use too)
mkgmap-dev mailing list mkgmap-dev@.org http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- keep on biking and discovering new trails
Felix openmtbmap.org & www.velomap.org
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi
@Steve: It would also be possible to create a new filter for that, but this would
What about checking when a point is added to a line that it is different to the previous one and not adding it if so. Then there could be an isValid() method that checks for more than 1 point for a line and more than 2 for a shape. ..Steve

Hi Steve, Steve Ratcliffe wrote
What about checking when a point is added to a line that it is different to the previous one and not adding it if so. Then there could be an isValid() method that checks for more than 1 point for a line and more than 2 for a shape.
The problem is that LinePreparer does its own rounding to the coords. The input can be a line with 5 different coords, but the calculated deltas are all 0. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Patch-for-routing-problems-in-r2448-and-highe... Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (4)
-
Felix Hartmann
-
GerdP
-
Minko
-
Steve Ratcliffe