logo separator

[mkgmap-dev] Not-equal compare bug?

From Gerd Petermann gpetermann_muenchen at hotmail.com on Sat Jan 5 19:10:49 GMT 2019

Hi Steve,

yes, I think the last block is was what I expected. The first block for tunnel=no surprised me because of the missing
railway=* clause in the first rearranged rule.


Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Steve Ratcliffe <steve at parabola.me.uk>
Gesendet: Samstag, 5. Januar 2019 19:41
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Not-equal compare bug?

Hi Gerd

> yes, I think this is a bug. In opposite to the previously posted rules your rules should work.
> @Steve: If I got that right the ExpressionArranger kicks in too early. It should only be called when the if-stack is empty (again).
> Can you have a look at it?

If you have:

        if (railway=*) then
          if (tunnel=no) then
                railway=rail      [0x14 resolution 21]
                () { set tunnel = yes }
                railway=tram      [0x15 resolution 21]

This is converted (correctly) to:

        $tunnel=no {set mkgmap:if:2='true';}
        $tunnel=no & $railway=rail & $railway=* [0x14 level 2]
        $tunnel=no & $railway=* {set tunnel='yes';}
        $mkgmap:if:2=true & $railway=tram & $railway=* [0x15 level 2]

But with tunnel!=no instead, this becomes:

        $tunnel!=no {set mkgmap:if:2='true';}
        $tunnel!=no & $railway=rail & $railway=* [0x14 level 2]
        $tunnel!=no & $railway=* {set tunnel='yes';}
        $mkgmap:if:2=true & $railway=tram & $railway=* [0x15 level 2]

and so fails on the first statement.

The only way to fix this that springs to mind is to instead convert
this to:

        railway=* && $tunnel!=no {set mkgmap:if:2='true';}
        $tunnel!=no & $railway=rail & $railway=* [0x14 level 2]
        $tunnel!=no & $railway=* {set tunnel='yes';}
        $mkgmap:if:2=true & $railway=tram [0x15 level 2]


mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk

More information about the mkgmap-dev mailing list