Changes between Version 204 and Version 205 of Help/Styles/MapCSSImplementation


Ignore:
Timestamp:
2022-03-10T17:39:19+01:00 (3 years ago)
Author:
skyper
Comment:

typo; adjust white spaces and remove them at EOL; remove empty lines

Legend:

Unmodified
Added
Removed
Modified
  • Help/Styles/MapCSSImplementation

    v204 v205  
    227227Selectors can include a set of conditions. If any of these conditions evaluates to false, the selector doesn't match and the style rule isn't applied.
    228228
    229 An '''attribute condition''' specifies a condition on a tag of an OSM object. 
     229An '''attribute condition''' specifies a condition on a tag of an OSM object.
    230230
    231231[=#condition_selector_operators]
    232 {{{#!th valign=top 
     232{{{#!th valign=top
    233233'''Operator'''
    234234}}}
     
    240240}}}
    241241|-------------------------------------------------------------------------------
    242 {{{#!td align=center  valign=top
     242{{{#!td align=center valign=top
    243243`=`
    244244}}}
    245 {{{#!td align=left  valign=top   
     245{{{#!td align=left valign=top
    246246Exact match of the value.
    247247}}}
    248 {{{#!td align=left  valign=top   
    249 {{{
    250 #!mapcss
    251 way[highway=residential]                    /* is case sensitive, i.e. does NOT match e.g. highway=Residential or Highway=residential */
    252 node[name="My name"]                        /* use quotes if key or value includes spaces */
     248{{{#!td align=left valign=top
     249{{{
     250#!mapcss
     251way[highway=residential]                    /* is case sensitive, i.e. does NOT match e.g. highway=Residential or Highway=residential   */
     252node[name="My name"]                        /* use quotes if key or value includes spaces                                               */
    253253node["name:ru"="Калининград"]               /* use quotes if key or value includes special characters like colons or unicode characters */
    254254}}}
    255255}}}
    256256|-------------------------------------------------------------------------------
    257 {{{#!td align=center  valign=top
     257{{{#!td align=center valign=top
    258258`!=`
    259259}}}
    260 {{{#!td align=left  valign=top   
    261 Value not equal 
    262 }}}
    263 {{{#!td align=left  valign=top   
     260{{{#!td align=left valign=top
     261Value not equal
     262}}}
     263{{{#!td align=left valign=top
    264264{{{
    265265#!mapcss
     
    270270}}}
    271271|-------------------------------------------------------------------------------
    272 {{{#!td align=center  valign=top
     272{{{#!td align=center valign=top
    273273`<`, `>`, `<=`, `>=`
    274274}}}
    275 {{{#!td align=left  valign=top   
    276 Comparision for numeric values.
    277 
    278 }}}
    279 {{{#!td align=left  valign=top   
     275{{{#!td align=left valign=top
     276Comparison for numeric values.
     277
     278}}}
     279{{{#!td align=left valign=top
    280280{{{
    281281#!mapcss
    282282node[population >= 50000]                   /* population greater than or equal to 50000 */
    283 node[ele = 3000]                            /* elevation with exactly 3000 meters */
    284 }}}
    285 }}}
    286 |-------------------------------------------------------------------------------
    287 {{{#!td align=center  valign=top
     283node[ele = 3000]                            /* elevation with exactly 3000 meters        */
     284}}}
     285}}}
     286|-------------------------------------------------------------------------------
     287{{{#!td align=center valign=top
    288288`^=`
    289289}}}
    290 {{{#!td align=left  valign=top   
     290{{{#!td align=left valign=top
    291291Prefix match
    292292}}}
    293 {{{#!td align=left  valign=top   
     293{{{#!td align=left valign=top
    294294{{{
    295295#!mapcss
     
    298298}}}
    299299|-------------------------------------------------------------------------------
    300 {{{#!td align=center  valign=top
     300{{{#!td align=center valign=top
    301301`$=`
    302302}}}
    303 {{{#!td align=left  valign=top   
     303{{{#!td align=left valign=top
    304304Postfix match
    305305}}}
    306 {{{#!td align=left  valign=top   
     306{{{#!td align=left valign=top
    307307{{{
    308308#!mapcss
     
    311311}}}
    312312|-----------------------------------------------
    313 {{{#!td align=center  valign=top
     313{{{#!td align=center valign=top
    314314`*=`
    315315}}}
    316 {{{#!td align=left  valign=top   
     316{{{#!td align=left valign=top
    317317Substring match
    318318}}}
    319 {{{#!td align=left  valign=top   
     319{{{#!td align=left valign=top
    320320{{{
    321321#!mapcss
     
    324324}}}
    325325|-------------------------------------------------------------------------------
    326 {{{#!td align=center  valign=top
     326{{{#!td align=center valign=top
    327327`~=`
    328328}}}
    329 {{{#!td align=left  valign=top   
     329{{{#!td align=left valign=top
    330330List membership
    331331}}}
    332 {{{#!td align=left  valign=top   
    333 {{{
    334 #!mapcss
    335 *[vending~=stamps]                          /* the tag value for the tag 'vending' consists of a list of ;-separated values    */
    336                                             /* and one of these values is 'stamps'                                             */
    337 }}}
    338 }}}
    339 |-------------------------------------------------------------------------------
    340 {{{#!td align=center  valign=top
     332{{{#!td align=left valign=top
     333{{{
     334#!mapcss
     335*[vending~=stamps]                          /* the tag value for the tag 'vending' consists of a list of ;-separated values */
     336                                            /* and one of these values is 'stamps'                                          */
     337}}}
     338}}}
     339|-------------------------------------------------------------------------------
     340{{{#!td align=center valign=top
    341341`=~`
    342342}}}
    343 {{{#!td align=left  valign=top   
     343{{{#!td align=left valign=top
    344344[https://download.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum Regular expression] match
    345345
    346346}}}
    347 {{{#!td align=left  valign=top   
     347{{{#!td align=left valign=top
    348348{{{
    349349#!mapcss
    350350*[name=~/^My_pattern.*/]                    /* the value of the tag 'name' matches with the regular expression '^My_pattern.*' */
    351                                             /* Note, that reqular expressions have to be enclosed in /.../                     */                 
     351                                            /* Note, that reqular expressions have to be enclosed in /.../                     */
    352352}}}
    353353Case-insensitive matching can be enabled via the embedded flag expression `(?i)` (see [https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#CASE_INSENSITIVE Pattern.CASE_INSENSITIVE]).
    354354{{{
    355355#!mapcss
    356 *[name =~ /^(?i)(parking)$/]                 /* matches parking, Parking, PARKING, PaRkInG,... */ 
    357 *[name =~ /^(?U)(\p{Lower})+$/]              /* name consists of only lower case unicode characters */                 
    358 }}}
    359 }}}
    360 |-------------------------------------------------------------------------------
    361 {{{#!td align=center  valign=top
     356*[name =~ /^(?i)(parking)$/]                 /* matches parking, Parking, PARKING, PaRkInG,...      */
     357*[name =~ /^(?U)(\p{Lower})+$/]              /* name consists of only lower case unicode characters */
     358}}}
     359}}}
     360|-------------------------------------------------------------------------------
     361{{{#!td align=center valign=top
    362362`!~` (since r6455)
    363363}}}
    364 {{{#!td align=left  valign=top   
     364{{{#!td align=left valign=top
    365365negated [https://download.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum Regular expression] match
    366366
    367367}}}
    368 {{{#!td align=left  valign=top   
     368{{{#!td align=left valign=top
    369369{{{
    370370#!mapcss
     
    373373}}}
    374374|-------------------------------------------------------------------------------
    375 {{{#!td align=center  valign=top
     375{{{#!td align=center valign=top
    376376`∈` ([https://www.fileformat.info/info/unicode/char/2208/index.htm U+2208], since r6609)
    377377}}}
    378 {{{#!td align=left  valign=top   
     378{{{#!td align=left valign=top
    379379element of
    380380
    381381Matches when an object matches the right selector(s) contains at least one element which match the left selector(s).
    382 
    383 }}}
    384 {{{#!td align=left  valign=top   
     382}}}
     383{{{#!td align=left valign=top
    385384{{{
    386385#!mapcss
     
    389388}
    390389}}}
    391 Finds areas with `amenity=parking` that contain at least one node or area with `amenity=parking`.
    392 Since r15064 this rule produces one warning for each element on the left when there are multiple matches.
    393 }}}
    394 |-------------------------------------------------------------------------------
    395 {{{#!td align=center  valign=top
     390Finds areas with `amenity=parking` that contain at least one node or area with `amenity=parking`. Since r15064 this rule produces one warning for each element on the left when there are multiple matches.
     391}}}
     392|-------------------------------------------------------------------------------
     393{{{#!td align=center valign=top
    396394`⊆` ([https://www.fileformat.info/info/unicode/char/2286/index.htm U+2286], since r15102)
    397395}}}
    398 {{{#!td align=left  valign=top   
     396{{{#!td align=left valign=top
    399397Subset of or Equal To
    400398
    401399Synonym for `∈`.
    402400}}}
    403 {{{#!td align=left  valign=top   
     401{{{#!td align=left valign=top
    404402{{{
    405403#!mapcss
     
    411409}}}
    412410|-------------------------------------------------------------------------------
    413 {{{#!td align=center  valign=top
     411{{{#!td align=center valign=top
    414412`⊇` ([https://www.fileformat.info/info/unicode/char/2287/index.htm U+2287], since r15102)
    415413}}}
    416 {{{#!td align=left  valign=top   
     414{{{#!td align=left valign=top
    417415Superset of or Equal To
    418416
    419417Matches when an object matches the right selector(s) and is contained in one or more elements which match the left selectors.
    420 
    421 }}}
    422 {{{#!td align=left  valign=top   
    423 {{{
    424 #!mapcss
    425 area[amenity=parking] ⊇ *[amenity=parking]
     418}}}
     419{{{#!td align=left valign=top
     420{{{
     421#!mapcss
     422area[amenity=parking] ⊇ *[amenity=parking]
    426423}}}
    427424finds nodes or areas with `amenity=parking` inside areas with `amenity=parking`. Slower than `⊆` and thus not useful in validator rules, but can be useful in the search dialog.
    428 
    429 }}}
    430 |-------------------------------------------------------------------------------
    431 {{{#!td align=center  valign=top
     425}}}
     426|-------------------------------------------------------------------------------
     427{{{#!td align=center valign=top
    432428`⊈` ([https://www.fileformat.info/info/unicode/char/2288/index.htm U+2288], since r15102)
    433429}}}
    434 {{{#!td align=left  valign=top   
     430{{{#!td align=left valign=top
    435431Neither a Subset of nor Equal To
    436432
    437433Matches when an object matches the right selector(s) and does not contain any element which matches the left selectors.
    438 
    439 }}}
    440 {{{#!td align=left  valign=top   
     434}}}
     435{{{#!td align=left valign=top
    441436{{{
    442437#!mapcss
    443438*[highway=street_lamp] ⊈ area:closed2[amenity=parking][lit=yes]
    444439}}}
    445 finds areas amenity=parking that have lit=yes but don't contain a lamp.
    446 Always add `:closed2` to avoid false positives as unclosed areas never contain something.
    447 }}}
    448 |-------------------------------------------------------------------------------
    449 {{{#!td align=center  valign=top
     440finds areas amenity=parking that have lit=yes but don't contain a lamp. Always add `:closed2` to avoid false positives as unclosed areas never contain something.
     441}}}
     442|-------------------------------------------------------------------------------
     443{{{#!td align=center valign=top
    450444`⊉` ([https://www.fileformat.info/info/unicode/char/2289/index.htm U+2289], since r15102)
    451445}}}
    452 {{{#!td align=left  valign=top   
     446{{{#!td align=left valign=top
    453447Neither a Superset of nor Equal To
    454448
    455449Matches when an object matches the right selector(s) and is not contained in any area which matches the left selectors.
    456 
    457 }}}
    458 {{{#!td align=left  valign=top   
     450}}}
     451{{{#!td align=left valign=top
    459452{{{
    460453#!mapcss
    461454area[landuse=residential] ⊉ *[building]
    462455}}}
    463 finds buildings which are not inside any landuse=residential area. Note that this operator is likely to produce false positives
    464 when you have `landuse=residential`areas which don't match `:closed2`.
    465 }}}
    466 |-------------------------------------------------------------------------------
    467 {{{#!td align=center  valign=top
     456finds buildings which are not inside any landuse=residential area. Note that this operator is likely to produce false positives when you have `landuse=residential`areas which don't match `:closed2`.
     457}}}
     458|-------------------------------------------------------------------------------
     459{{{#!td align=center valign=top
    468460`⧉` ([https://www.fileformat.info/info/unicode/char/29c9/index.htm U+29C9], since r6613)
    469461}}}
    470 {{{#!td align=left  valign=top   
     462{{{#!td align=left valign=top
    471463crossing
    472 
    473 }}}
    474 {{{#!td align=left  valign=top   
     464}}}
     465{{{#!td align=left valign=top
    475466{{{
    476467#!mapcss
     
    551542{{{
    552543#!mapcss
    553 way[oneway?]                  /* matches any way with a truth value in the tag 'oneway'  */
     544way[oneway?]                   /* matches any way with a truth value in the tag 'oneway' */
    554545}}}
    555546}}}
     
    561552{{{
    562553#!mapcss
    563 way[oneway?!]                  /* matches any way with a false value in the tag 'oneway'  */
     554way[oneway?!]                  /* matches any way with a false value in the tag 'oneway' */
    564555}}}
    565556}}}