Error in style file relations?

Hi all, the default style contains this: # European E-Road network route=road & network=e-road { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' add mkgmap:fast_road=yes; } } If I got that right there should be a semicolon after add network='e-road' Or is this a very special syntax? Gerd

Hi all, okay, it was an error in the style, but it had no effect because this rule in lines highway=* & mkgmap:fast_road!=* & (int_ref=* | network=e-road | network=AH | network=TAH | network=US:I | network=US:US) {add mkgmap:fast_road=yes} adds the tag mkgmap:fast_road=yes that was not added in the relation rule. @Steve: I was a bit surprised that the wrong rule still sets network to 'e-road' and not to something like "e-road add mkgmap:fast_road=yes" Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <GPetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 1. Februar 2018 16:25 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Error in style file relations? Hi all, the default style contains this: # European E-Road network route=road & network=e-road { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' add mkgmap:fast_road=yes; } } If I got that right there should be a semicolon after add network='e-road' Or is this a very special syntax? Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Here is a patch to fix the problem where commands that are not separated by a semi-colon are not ignored. Various possible errors are now caught instead of being silently ignored. In the original relation file that Gerd fixed, there was the following: $route=road & $network='e-road' { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' # missing semi-colon add mkgmap:fast_road='yes'; } } this was being read as: $route=road & $network='e-road' { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' | 'add' | 'mkgmap:fast_road' | '=' | 'yes'; } } Since 'e-road' does not contain any variables, then it was always the value that 'network' was set to. Now you do not need any of the semi-colons, so the original code would be read as intended. I don't believe that there were any more similar errors in the style file, so this patch should have no effect for the default style. Of course it may find errors in custom styles, or something that did not work before may suddenly start to work as intended causing a difference. ..Steve

Hi Steve, I've tried it with Minkos style which uses this as last line in the lines file include 'inc/compat_lines'; I see this error message: Error in style: Error: (inc/compat_lines:124): Unrecognised command 'no' line 124 is: mkgmap:carpool_compat=yes { setaccess=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes } I assume it should be mkgmap:carpool_compat=yes { setaccess no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes } but maybe WanMil meant mkgmap:carpool_compat=yes { set access=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes } I've never fully understood that syntax. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Freitag, 2. Februar 2018 14:04 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in style file relations? Hi Here is a patch to fix the problem where commands that are not separated by a semi-colon are not ignored. Various possible errors are now caught instead of being silently ignored. In the original relation file that Gerd fixed, there was the following: $route=road & $network='e-road' { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' # missing semi-colon add mkgmap:fast_road='yes'; } } this was being read as: $route=road & $network='e-road' { apply { add ref='${ref}'; add int_ref='${int_ref}'; add network='e-road' | 'add' | 'mkgmap:fast_road' | '=' | 'yes'; } } Since 'e-road' does not contain any variables, then it was always the value that 'network' was set to. Now you do not need any of the semi-colons, so the original code would be read as intended. I don't believe that there were any more similar errors in the style file, so this patch should have no effect for the default style. Of course it may find errors in custom styles, or something that did not work before may suddenly start to work as intended causing a difference. ..Steve

Hi Gerd
line 124 is: mkgmap:carpool_compat=yes { setaccess=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
I assume it should be mkgmap:carpool_compat=yes { setaccess no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
but maybe WanMil meant mkgmap:carpool_compat=yes { set access=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
Ha.. yes it could be either. My guess would be that it should be 'setaccess no' as it is followed by some of the access flags. Steve

Thanks for noticing this, I'll change it in my styles ________________________________ Van: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> namens Steve Ratcliffe <steve@parabola.me.uk> Verzonden: vrijdag 2 februari 2018 06:42:14 Aan: mkgmap-dev@lists.mkgmap.org.uk Onderwerp: Re: [mkgmap-dev] Error in style file relations? Hi Gerd
line 124 is: mkgmap:carpool_compat=yes { setaccess=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
I assume it should be mkgmap:carpool_compat=yes { setaccess no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
but maybe WanMil meant mkgmap:carpool_compat=yes { set access=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
Ha.. yes it could be either. My guess would be that it should be 'setaccess no' as it is followed by some of the access flags. Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Steve, I did not understand the exact meaning of the error message Error in style: Error: (inc/compat_lines:124): Unrecognised command 'no' but the patch fixes the original problem and shows that there is an error in this line, so I think you should commit it. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve@parabola.me.uk> Gesendet: Freitag, 2. Februar 2018 15:42 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Error in style file relations? Hi Gerd
line 124 is: mkgmap:carpool_compat=yes { setaccess=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
I assume it should be mkgmap:carpool_compat=yes { setaccess no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
but maybe WanMil meant mkgmap:carpool_compat=yes { set access=no; set mkgmap:bus=yes; set mkgmap:emergency=yes; set mkgmap:carpool=yes }
Ha.. yes it could be either. My guess would be that it should be 'setaccess no' as it is followed by some of the access flags. Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd
I did not understand the exact meaning of the error message
Error in style: Error: (inc/compat_lines:124): Unrecognised command 'no'
I guess there is some room for a better message there. The problem is that setaccess takes one argument, so that setaccess=no is really: setaccess =; no; Probably anything that isn't 'yes' is treated as 'no', so that '=' is accepted without complaint and then 'no' is treated as a command which fails. I shall add a check for a valid argument to setaccess. ..Steve

Hi Gerd I would have expected it to either work as if the semi colon was there, or give an error. I'll take a look when I get home Steve
@Steve: I was a bit surprised that the wrong rule still sets network to 'e-road' and not to something like "e-road add mkgmap:fast_road=yes"
participants (4)
-
Gerd Petermann
-
Gerd Petermann
-
lig fietser
-
Steve Ratcliffe