I ran into this bug many years ago - but back then I either assumed or got
told that the first rule must not be != but has to be plain =.
However I think it simply did not work instead of throwing a stack overflow.
On 7 August 2017 at 22:43, Steve Ratcliffe <st...@parabola.me.uk> wrote:
> Every now and again, there is a bug report on a style rule that gives
> an error when it shouldn't. The most recent from Mike Baggaley,
> included a case where the rule was accepted but the result was
> I wrote a little program to generate random rules and test them using
> the style tester.
> This showed that there were many rules that should be accepted that
> are not and worse there are cases where the wrong result is given.
> Worst of all this simple rule:
> a>=1 & (a=1 | b~2) [0x2]
> (and many others) crash mkgmap with a StackOverflowError. I'm
> surprised that no-one has found that. Perhaps they have and it just
> hasn't been reported.
> An example of a rule that is accepted but doesn't work is:
> (a!=1 | b~2) & a<2 & a>=2 [0x2]
> This matches (with trunk) with a way with tags a=2 and b=2
> but it should not.
> So not very complex rules fail. There are also vast number of rules
> that involve using not (!) such as !(highway=service & ...) that are
> not accepted or do not work. Probably not many styles have many such
> rules though.
> So I re-wrote and simplified the code and the result is
> on the expr branch.
> There is also a new feature that was needed to help make it
> work. There is now a not regex match operator !~. It is
> probably not all that useful but it is now availabl.
> name !~ 'Main.*'
> is exactly the same as
> !(name ~ 'Main.*')
> The latest branch build can be downloaded from:
> It is important to test it, as although I believe that the branch is
> now correct, some styles may have been relying on previous bugs.
> mkgmap-dev mailing list
Felix Hartman - Openmtbmap.org & VeloMap.org
Austria - Österreich
mkgmap-dev mailing list