
Hi all, as A drian pointed out here: http://gis.19327.n5.nabble.com/Bug-in-handling-of-bus-stops-tp5832099.html we have a bug in the style evaluation system. The attached patch makes sure that each rule is only evaluated once for one element. If I got it right the problem occurs with rules that combine two "or" expressions, like (a | b) & ( c | d) { do something } A binary based on r3436 is here: http://files.mkgmap.org.uk/download/244/mkgmap.jar @Steve: Please review, I've added a new field "matched" to WatchableTypeResult but I think the field "found" was already intended for this? Maybe you find a better place to fix this? Gerd

Hi Gerd
@Steve: Please review, I've added a new field "matched" to WatchableTypeResult but I think the field "found" was already intended for this? Maybe you find a better place to fix this?
The problem with OR leading to multiple matches is supposed to be handled by LinkedOp. Something does seem to go wrong in the cases you have discovered however. I'll see if I can figure out what is happening. The following StyleTester test shows the problem. It seems that three OR'ed terms followed by an AND triggers it. Two OR'ed terms is not enough. --------- WAY highway=primary name=b c=60 d=50 <<<lines>>> (name=b | highway=primary | d=50) & highway=primary { set name='a${name}' } highway=primary [0x2] <finalize> highway=* {name '${name}'} <<<results>>> WAY 1: Line 0x2, labels=[ab, null, null, null], res=24-24 (1/1),(2/2),

Hi I found a place in the code which only dealt with a single OR. Changing that to deal with any number seems to fix the problem. There is however a problem that a test fails. It does not appear to be directly related to the fix, since it only occurs when resolving the same way with different (changed) tags against the same rule set. That needs more investigation. Patch attached, and jar here: http://files.mkgmap.org.uk/download/247/mkgmap.jar
as A drian pointed out here:
http://gis.19327.n5.nabble.com/Bug-in-handling-of-bus-stops-tp5832099.html
we have a bug in the style evaluation system. The attached patch makes sure that each rule is only evaluated once for one element. If I got it right the problem occurs with rules that combine two "or" expressions, like (a | b) & ( c | d) { do something }
A binary based on r3436 is here: |http://files.mkgmap.org.uk/download/244/mkgmap.jar | @Steve: Please review, I've added a new field "matched" to WatchableTypeResult but I think the field "found" was already intended for this? Maybe you find a better place to fix this?
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I can confirm that all of these work with my example: http://files.mkgmap.org.uk/download/244/mkgmap.jar http://files.mkgmap.org.uk/download/245/mkgmap.jar http://files.mkgmap.org.uk/download/247/mkgmap.jar Adrian

Hi Steve, reg. the failed test: I think you can change the test because StyledConverter doesn't do this (at least not now). If you think it should be working we would need a method to reset the field "current" in all LinkedOps so that they are evaluated again for the same Element instance. Gerd Date: Mon, 2 Feb 2015 23:26:09 +0000 From: steve@parabola.me.uk To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] [Patch v1] avoid duplicate evaluation of rules Hi I found a place in the code which only dealt with a single OR. Changing that to deal with any number seems to fix the problem. There is however a problem that a test fails. It does not appear to be directly related to the fix, since it only occurs when resolving the same way with different (changed) tags against the same rule set. That needs more investigation. Patch attached, and jar here: http://files.mkgmap.org.uk/download/247/mkgmap.jar
as A drian pointed out here:
http://gis.19327.n5.nabble.com/Bug-in-handling-of-bus-stops-tp5832099.html
we have a bug in the style evaluation system. The attached patch makes sure that each rule is only evaluated once for one element. If I got it right the problem occurs with rules that combine two "or" expressions, like (a | b) & ( c | d) { do something }
A binary based on r3436 is here: |http://files.mkgmap.org.uk/download/244/mkgmap.jar | @Steve: Please review, I've added a new field "matched" to WatchableTypeResult but I think the field "found" was already intended for this? Maybe you find a better place to fix this?
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Steve, this problem is still open. I think the patch is okay, only the tests are not. Gerd
Date: Tue, 3 Feb 2015 13:27:35 +0000 From: steve@parabola.me.uk To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] [Patch v1] avoid duplicate evaluation of rules
Hi Gerd
If you think it should be working we would need a method to reset the field "current" in all LinkedOps so that they are evaluated again for the same Element instance.
Ahh, OK thanks I see. I will just create a new Element copy for that stage of the test then.
..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
A drian
-
Gerd Petermann
-
Steve Ratcliffe