"Invalid rule expression" for expression in line file after upgrade from r3649 to r3693

Gents, With newest release r3693 I'm having troubles creating a map with a style file 'line' containing the following expression (it worked with r3649 and earlier version): maxspeed = * & ( maxspeedkmh()>120 | maxspeed = none ) & ( highway = motorway | highway = trunk ) { set mkgmap:road-speed-class = 7 } It bailes out with the following error codes in the output: java -Xmx1536M -jar D:/fzk/develop/fzk-mde-garmin/Freizeitkarte-Entwicklung/tools/mkgmap/mkgmap.jar --max-jobs=2 -c Freizeitkarte_CHE.cfg --check-styles Time started: Fri Aug 12 12:14:08 CEST 2016 Found one style in D:/fzk/develop/fzk-mde-garmin/Freizeitkarte-Entwicklung/work/Freizeitkarte_CHE_de/style/fzk Error in style: Error: (lines:442): Invalid rule expression: (((maxspeedkmh()>120)|($maxspeed='none'))&((($highway='motorway')|($highway='trunk'))&$maxspeed=*)) could not open style fzk finished check-styles Error in style: Error: (lines:442): Invalid rule expression: (((maxspeedkmh()>120)|($maxspeed='none'))&((($highway='motorway')|($highway='trunk'))&$maxspeed=*)) Error in style: Error: (lines:442): Invalid rule expression: (((maxspeedkmh()>120)|($maxspeed='none'))&((($highway='motorway')|($highway='trunk'))&$maxspeed=*)) Error in style: Error: (lines:442): Invalid rule expression: (((maxspeedkmh()>120)|($maxspeed='none'))&((($highway='motorway')|($highway='trunk'))&$maxspeed=*)) Error in style: Error: (lines:442): Invalid rule expression: (((maxspeedkmh()>120)|($maxspeed='none'))&((($highway='motorway')|($highway='trunk'))&$maxspeed=*)) Could not open style Number of ExitExceptions: 1 When just changing the order of the expressions (without changing the logic/result) as shown below it works properly also with release r3693: maxspeed = * & ( highway = motorway | highway = trunk ) & ( maxspeedkmh()>120 | maxspeed = none ) { set mkgmap:road-speed-class = 7 } Is it possible that the 'fixes' for r3667 or r3671 fixed some errors but brought a new one in ? Or do I completely misunderstand the concept of these expressions ? Thanks for checking Patrik

Hi
With newest release r3693 I'm having troubles creating a map with a style file 'line' containing the following expression (it worked with r3649 and earlier version):
maxspeed = * & ( maxspeedkmh()>120 | maxspeed = none ) & ( highway = motorway | highway = trunk ) { set mkgmap:road-speed-class = 7 }
Thanks for reporting this. I've prepared a patch attached and a pre-built jar file here: http://files.mkgmap.org.uk/download/308/mkgmap.jar It's possible that this fix will in turn fail on some expressions that used to work.
When just changing the order of the expressions (without changing the logic/result) as shown below it works properly also with release r3693:
maxspeed = * & ( highway = motorway | highway = trunk ) & ( maxspeedkmh()>120 | maxspeed = none ) { set mkgmap:road-speed-class = 7 }
mkgmap is failing to re-arrange the expression properly, you can always re-arrange it yourself by moving the more complex expressions towards the end. Or to find bugs move them to the beginning!
Is it possible that the 'fixes' for r3667 or r3671 fixed some errors but brought a new one in ? Or do I completely misunderstand the concept of these expressions ?
Yes, there have been a few of these reported recently. Each bug that is fixed has a test, so we are gradually eliminating the problems, even if new ones appear. Cheers, ..Steve

Steve, just testet out the intermediate mkgmap.jar. I can confirm that it now runs through again with both versions of my expression, the inital one that triggered the error as well as the rearranged one which I used as a workaround. I assume that solution will make its way into the next official release. Thanks for the quick fix and the explanations around it. Patrik On 12.08.2016 15:35, Steve Ratcliffe wrote:
Hi
With newest release r3693 I'm having troubles creating a map with a style file 'line' containing the following expression (it worked with r3649 and earlier version):
maxspeed = * & ( maxspeedkmh()>120 | maxspeed = none ) & ( highway = motorway | highway = trunk ) { set mkgmap:road-speed-class = 7 }
Thanks for reporting this. I've prepared a patch attached and a pre-built jar file here: http://files.mkgmap.org.uk/download/308/mkgmap.jar
It's possible that this fix will in turn fail on some expressions that used to work.
When just changing the order of the expressions (without changing the logic/result) as shown below it works properly also with release r3693:
maxspeed = * & ( highway = motorway | highway = trunk ) & ( maxspeedkmh()>120 | maxspeed = none ) { set mkgmap:road-speed-class = 7 }
mkgmap is failing to re-arrange the expression properly, you can always re-arrange it yourself by moving the more complex expressions towards the end.
Or to find bugs move them to the beginning!
Is it possible that the 'fixes' for r3667 or r3671 fixed some errors but brought a new one in ? Or do I completely misunderstand the concept of these expressions ?
Yes, there have been a few of these reported recently. Each bug that is fixed has a test, so we are gradually eliminating the problems, even if new ones appear.
Cheers, ..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

sort of late... but nevertheless: many thanks. Patrik On 18.08.2016 23:50, Steve Ratcliffe wrote:
Hi
I assume that solution will make its way into the next official release
It is now in mkgmap-r3694
Thanks, ..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (2)
-
Patrik Brunner
-
Steve Ratcliffe