[Mapcss] Questions concerning tests

Tom Davie tom.davie at gmail.com
Mon Sep 16 20:16:52 UTC 2013


On 16 Sep 2013, at 21:32, Stephan Bösch-Plepelits <skunk at xover.htu.tuwien.ac.at> wrote:

> Hi!
> 
> 1. Unary tests
> --------------
> The MapCSS 0.2 specification[1] says the following about unary tests:
>  way[highway]       /* Matches against all ways with the highway tag set */
>  way[!highway]      /* Matches against all ways with the highway tag not set (or set to no/false) */
> 
> Question: Wouldn't it be more logical if the first statement does not match
> ways with the highway tag set to no or false?

No, you can already test for that with way[highway=false], you can’t test for the tag not existing any other way.

> 2. Eval boolean type
> --------------------
> A boolean
>  expression is considered "false" if it equals to "0", "no", "false" or ""
>  (empty string); [2]
> 
> Question: Shouldn't the unary test (above) also consider "0" as false?
> 
> [1] http://wiki.openstreetmap.org/wiki/MapCSS/0.2#Tests
> [2] http://wiki.openstreetmap.org/wiki/MapCSS/0.2/eval

No, because the unary test isn’t checking if it’s false or not, it’s checking if it exists or not.  Note, way[highway] should match against things tagged highway=false.

Tom Davie


More information about the Mapcss mailing list