[Mapcss] Questions concerning tests

Andrew Shadura bugzilla at tut.by
Wed Sep 18 08:16:58 UTC 2013


Hello again,

On 18 September 2013 10:09, Andrew Shadura <bugzilla at tut.by> wrote:
> On 16 September 2013 21:32, Stephan Bösch-Plepelits
> <skunk at xover.htu.tuwien.ac.at> wrote:
>> 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?

> Well, the idea behind this selector test was to make it easy to tell
> oneway=yes/1/-1 from oneway=no or missing oneway, for example. This
> allows for simpler conditions in selectors. Probably, way[highway]
> form shouldn't match oneway=no. Also, probably 0 should be treated the
> same as no.

> However, JOSM approach to MapCSS is slightly different: they decided
> to remove this boolean condition. So in JOSM way[highway] matches
> highway=no and way[!highway] doesn't match highway=no.

> I don't know which approach is better, but we need to decide somehow.

Just looked into JOSM MapCSS dialect spec. They have way[highway?]
syntax for testing if the tag value is true or not. However, they do
it other way around:

> You can test whether the the value of a tag is logical truth value.
> The value is evaluated to true, if it is either "yes", "true", or "1".
> All other values are evaluated to false.

I find this a little bit strange, as oneway=-1 *is* a oneway road.
Same, building=roof *is* a building, when building=no technically
isn't.

However, I guess, adopting JOSM question mark syntax may be a good idea.

-- 
WBR, Andrew



More information about the Mapcss mailing list