Finalize section not working as expected

I got a very nasty bug here. IMHO it must be somehow related to the finalize section in the lines file of the style. http://www.openstreetmap.org/#map=16/47.9114/10.5862 When routing along the bicycleway along the "OAL12" from the roundabout to Irsee. Choosing "Mountainbike" or "Tourbike" as Activity and "shortest distance" as Calculating method always leads me on a heavy Trail. I have rules in the style that set "bicycle=no" for this trail, but they do not seem to have any effect unless I include them BEFORE the garmin type gets assigned. In the finalize section they seem to be ignored. At least on my OREGON 550 with latest Firmware. A few screenshots: <http://gis.19327.n5.nabble.com/file/n5800737/Roundabout82.bmp> <http://gis.19327.n5.nabble.com/file/n5800737/2-Target_in_Irsee127.bmp> <http://gis.19327.n5.nabble.com/file/n5800737/3-Choose_Tourbike_or_Mountainbike137.bmp> <http://gis.19327.n5.nabble.com/file/n5800737/4-Choose_short_distance141.bmp> <http://gis.19327.n5.nabble.com/file/n5800737/5-Routing_broken_why_182.bmp> <http://gis.19327.n5.nabble.com/file/n5800737/6-Routing_correct_with_hacked_style167.bmp> I composed a test case http://files.mkgmap.org.uk/download/188/test_case.tgz this is the only change in the style that makes routing work: / test_cases/mystyles$ diff -uws bikemap_style_hacked/ bikemap_style Gemeinsame Unterverzeichnisse: bikemap_style_hacked/inc und bikemap_style/inc. Dateien bikemap_style_hacked/info und bikemap_style/info sind identisch. diff -uws bikemap_style_hacked/lines bikemap_style/lines --- bikemap_style_hacked/lines 2014-03-23 13:08:03.295102817 +0100 +++ bikemap_style/lines 2014-03-22 19:20:03.000000000 +0100 @@ -534,8 +534,6 @@ #------------------------------------------------------------------------------ # path -# HACK include access rules before path rules -include 'inc/compat_access' ; highway=path | highway=trail | highway=byway [0x11012 resolution 24 continue] Dateien bikemap_style_hacked/options und bikemap_style/options sind identisch. Dateien bikemap_style_hacked/points und bikemap_style/points sind identisch. Dateien bikemap_style_hacked/polygons und bikemap_style/polygons sind identisch. Dateien bikemap_style_hacked/README und bikemap_style/README sind identisch. Dateien bikemap_style_hacked/relations und bikemap_style/relations sind identisch. Dateien bikemap_style_hacked/version und bikemap_style/version sind identisch. / -- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Some additional hints: I get this problem in 100% of the cases I tested, on ORGON 550. Did not matter what map was built. Bernd tried to reproduce the bug with a "bayern" map but did not get the bug neither on his OREGON 650 nor in BASECAMP. For faster testing I created a test-area called "xx", and with this area Bernd was able to reproduce the bug. He thinks it might be related to a tile boundary problem. Polygon of the test area: xx.poly <http://gis.19327.n5.nabble.com/file/n5800742/xx.poly> Tile-boundaries produced by splitter: xx.kml <http://gis.19327.n5.nabble.com/file/n5800742/xx.kml> Test areas.list: xx_areas.list <http://gis.19327.n5.nabble.com/file/n5800742/xx_areas.list> --- Somehow the notes for my screenshots got lost. 1st shows the starting point - does not really matter - just somewhere on the cycleway 2nd shows the target - does not really matter - just somewhere in Irsee or beyond 3rd shows Activity selection - IMPORTANT chosse Tourbike or Mountainbike 4th shows the calculation method - IMPORTANT choose "short distance" 5th shows the wrong route with the unmodified style 6th shows the correct route with the hacked style It is also important to go uphill - routing in the opposite direction works. -- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com.

the rules in question are: / highway=path & ( smoothness~'.*(horrible|impassable)' | smoothness=very_bad | mtb:scale>0 | mtb:scale:imba>0 ) { set bicycle=no } highway=path & ( sac_scale~'.*(mountain|alpine)_hiking' | smoothness=bad ) { add bicycle=no; } / When I put then directly in the lines file, before the path definition rules, routing works as expected. But when I put them in a separate file included in the finalize section it does not work reliably. We tried some diagnosis with "echo" and found that the rules get called in any case. Just that on the GARMIN Device they do not apply when called in the finalize section !?! There must be some difference in the generated img file that should not be there. I suspect that the "path" gets written to the img before the set bicycle=no is applied. -- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Franco, when you put these lines in the finalize section, is that before or after the line include 'inc/access'; ? Remember that mkgmap evaluates mkgmap:bicycle=*, not bicycle=*. Gerd
Date: Sun, 23 Mar 2014 22:47:05 -0700 From: franco.bez@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Finalize section not working as expected
the rules in question are: / highway=path & ( smoothness~'.*(horrible|impassable)' | smoothness=very_bad | mtb:scale>0 | mtb:scale:imba>0 ) { set bicycle=no } highway=path & ( sac_scale~'.*(mountain|alpine)_hiking' | smoothness=bad ) { add bicycle=no; } /
When I put then directly in the lines file, before the path definition rules, routing works as expected.
But when I put them in a separate file included in the finalize section it does not work reliably.
We tried some diagnosis with "echo" and found that the rules get called in any case. Just that on the GARMIN Device they do not apply when called in the finalize section !?!
There must be some difference in the generated img file that should not be there. I suspect that the "path" gets written to the img before the set bicycle=no is applied.
-- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Am Montag, 24. März 2014, 08:23:56 schrieb Gerd Petermann:
when you put these lines in the finalize section, is that before or after the line include 'inc/access'; both tested, same result
? Remember that mkgmap evaluates mkgmap:bicycle=*, not bicycle=*. But this could be my error, i will try this
this workaround for routing blocking crossing:barrier crossing:barrier!=no {addaccess yes; set mkgmap:road-speed=0;} work expected in include 'inc/compat_access'; after include 'inc/access'; Bernd

Am Montag, 24. März 2014, 09:19:44 schrieb Bernd Weigelt:
include 'inc/access';
both tested, same result
? Remember that mkgmap evaluates mkgmap:bicycle=*, not bicycle=*.
But this could be my error, i will try this
Made some tests: highway=path & ( smoothness~'.*(horrible|impassable)' | smoothness=very_bad | mtb:scale>0 | mtb:scale:imba>0 ) { set mkgmap:bicycle=no } highway=path & ( sac_scale~'.*(mountain|alpine)_hiking' | smoothness=bad ) { add mkgmap:bicycle=no; } this rules at the end of inc/compat_access didn't work, tested with inc/access before and after inc/compat_access and they didn't work, if i do them at the begin of inc/access. This is a little bit to high for my little mind It works, if i do this rules in inc/access, it is clear for me, why this works highway=path & ( smoothness~'.*(horrible|impassable)' | smoothness=very_bad | mtb:scale>0 | mtb:scale:imba>0 ) { set bicycle=no } highway=path & ( sac_scale~'.*(mountain|alpine)_hiking' | smoothness=bad ) { add bicycle=no; } Bernd

Hi Bernd, sorry, I can't follow. Please post two complete styles, one that is working as expected, another which is not. This will help to find out what is different. Gerd
From: weigelt.bernd@web.de To: mkgmap-dev@lists.mkgmap.org.uk Date: Mon, 24 Mar 2014 10:15:29 +0100 Subject: Re: [mkgmap-dev] Finalize section not working as expected
Am Montag, 24. März 2014, 09:19:44 schrieb Bernd Weigelt:
include 'inc/access';
both tested, same result
? Remember that mkgmap evaluates mkgmap:bicycle=*, not bicycle=*.
But this could be my error, i will try this
Made some tests:
highway=path & ( smoothness~'.*(horrible|impassable)' | smoothness=very_bad | mtb:scale>0 | mtb:scale:imba>0 ) { set mkgmap:bicycle=no } highway=path & ( sac_scale~'.*(mountain|alpine)_hiking' | smoothness=bad ) { add mkgmap:bicycle=no; }
this rules at the end of inc/compat_access didn't work, tested with inc/access before and after inc/compat_access and they didn't work, if i do them at the begin of inc/access.
This is a little bit to high for my little mind
It works, if i do this rules in inc/access, it is clear for me, why this works
highway=path & ( smoothness~'.*(horrible|impassable)' | smoothness=very_bad | mtb:scale>0 | mtb:scale:imba>0 ) { set bicycle=no } highway=path & ( sac_scale~'.*(mountain|alpine)_hiking' | smoothness=bad ) { add bicycle=no; }
Bernd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Am Montag, 24. März 2014, 10:20:58 schrieb Gerd Petermann:
Hi Bernd,
sorry, I can't follow. Please post two complete styles, one that is working as expected, another which is not. This will help to find out what is different.
Done http://files.mkgmap.org.uk/detail/189 http://files.mkgmap.org.uk/detail/190 you can use the xx.o5m from Franco's testcase, please route from somewhere near the turning circle [1] to OAL12 [2] in Irsee. You can use bicycle, tourcycling or mountainbike with short distance on your oregon. Then take a look at the Waldbauschülerpfad [3], the southwestern part [4] is the problem Please keep in mind, this problem happened not with every extract from a local planet, but with Franco's xx.o5m and my DACH extract. BTW: Cyclerouting works great now, i'm using most time tourcycling with short distance. Great work, thank you Bernd [1] http://www.openstreetmap.org/#map=18/47.91460/10.60397 [2] http://www.openstreetmap.org/#map=19/47.90889/10.57541 [3] http://www.openstreetmap.org/#map=18/47.91155/10.57797 [4] http://www.openstreetmap.org/way/32695806 -- amarok2 now playing: artist: The Housemartins title: Rap Around The Clock album: Raise The Flag

the xx.o5m is not in the test_case. I just sent it to Bernd directly. But in the test case there is a very small osm file that contains just the problematic area. On my Oregon this produced the bug in 100% of the cases. -- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi, check the line access=* { addaccess '${access}' } in inc\access If I got that right any tag related to access should be set before this line. In f:\osm\berndw\bikemap_not_ok it comes after this line. Does that make sense? Gerd
Date: Mon, 24 Mar 2014 03:45:45 -0700 From: franco.bez@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Finalize section not working as expected
the xx.o5m is not in the test_case. I just sent it to Bernd directly.
But in the test case there is a very small osm file that contains just the problematic area.
On my Oregon this produced the bug in 100% of the cases.
-- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Am Montag, 24. März 2014, 11:49:34 schrieb Gerd Petermann:
check the line access=* { addaccess '${access}' }
in inc\access
I copied inc/access from the default style, there is the same line i have added compat_access for my style, because i don't want to change something in inc/access without need.
If I got that right any tag related to access should be set before this line. In f:\osm\berndw\bikemap_not_ok it comes after this line.
Does that make sense?
Truly jein ;-) I understand what you mean, but i have made also tests with include inc/compat_access _before_ inc/access in lines with the same annoyance. I can live with a changed inc/access, but it is only a workaround for me. It's easier with a unchanged file, when i try to tell you my thoughts. My english isn't good enough for exact descriptions Bernd -- amarok2 now playing: artist: Madonna title: Spotlight album: You Can Dance

Hi Bernd, okay, it is weird. I was wrong, both version should result in exactly the same set of rules. I agree that something in the RuleFileReader must be wrong. @Steve: Can you have a look at it? Gerd
From: weigelt.bernd@web.de To: mkgmap-dev@lists.mkgmap.org.uk Date: Mon, 24 Mar 2014 12:06:00 +0100 Subject: Re: [mkgmap-dev] Finalize section not working as expected
Am Montag, 24. März 2014, 11:49:34 schrieb Gerd Petermann:
check the line access=* { addaccess '${access}' }
in inc\access
I copied inc/access from the default style, there is the same line i have added compat_access for my style, because i don't want to change something in inc/access without need.
If I got that right any tag related to access should be set before this line. In f:\osm\berndw\bikemap_not_ok it comes after this line.
Does that make sense?
Truly jein ;-)
I understand what you mean, but i have made also tests with include inc/compat_access _before_ inc/access in lines with the same annoyance.
I can live with a changed inc/access, but it is only a workaround for me. It's easier with a unchanged file, when i try to tell you my thoughts.
My english isn't good enough for exact descriptions
Bernd
-- amarok2 now playing: artist: Madonna title: Spotlight album: You Can Dance
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I just made a few more tests. Steve Ratcliffe wrote
On 24/03/14 11:42, Gerd Petermann wrote:
@Steve: Can you have a look at it?
I used each set of rules with the file test_area_irsee.osm
The resulting files were identical apart from the timestamps.
So I am unable to replicate any actual difference with those files.
..Steve
using the original styles from my test_case you should have had differences in the img files. But it is now obvious to me that the include of "inc/compat_access" should have been *before* "inc/access" not *after* So I changed the order of the includes and for me it seems to work, at least with the test_area_irsee.osm. I found no difference in routing if I include "inc/compat_access" right before "inc/access" or if I just paste it's content to the beginning of "inc/access" . The rules had to remain setting *bicycle=no* and *NOT mkgmap:bicycle=no* though, but it's also obvious why: inc/access reads /# set (override) specific restrictions bicycle=* { set mkgmap:bicycle='${bicycle}' } / that's why it's overriding any mkgmap:bicycle value previously set. I will do a few more tests, but currently I consider it beeing a bug in my style rather than a bug in mkgmap. Thanks for all the help :-) -- View this message in context: http://gis.19327.n5.nabble.com/Finalize-section-not-working-as-expected-tp58... Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (4)
-
Bernd Weigelt
-
franco_bez
-
Gerd Petermann
-
Steve Ratcliffe