Changes between Version 8 and Version 9 of Ru:Help/Styles/MapCSSImplementation


Ignore:
Timestamp:
2018-04-04T14:48:12+02:00 (7 years ago)
Author:
ak099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Ru:Help/Styles/MapCSSImplementation

    v8 v9  
    406406}}}
    407407
    408 Since r6554, it is possible to prefix the "value" (i.e., expression after the operator) with a `*` in order to "de-reference" it (i.e., obtain consider it as another key and obtain its value). Thus, `[key1 = *key2]` or `[key1=*key2]` compares the value of `key1` with the value of `key2`, and `[key =~ */pattern/]` considers the value of the key `pattern` as a regular expression and matches it against the value of `key`.
     408Начиная с r6554, возможно предварить "значение" (т.е. выражение после оператора) символом `*` для его "разыменования" (i.e., obtain consider it as another key and obtain its value). Таким образом, `[key1 = *key2]` или `[key1=*key2]` сравнивает значение `key1` со значением `key2`, а `[key =~ */pattern/]` рассматривает значение ключа `pattern` как регулярное выражение и сравнивает его со значением ключа `key`.
    409409
    410410In addition, you can test whether a tag is present or not:
    411411
    412412{{{#!th align=left valign=top
    413 '''Condition'''
     413'''Условие'''
    414414}}}
    415415{{{#!th align=left valign=top
    416 '''Example'''
    417 }}}
    418 |-------------------------------------------------------------------------------
    419 {{{#!td align=left  valign=top
    420 Presence of tag
     416'''Пример'''
     417}}}
     418|-------------------------------------------------------------------------------
     419{{{#!td align=left  valign=top
     420Наличие тега
    421421}}}
    422422{{{#!td align=left  valign=top   
     
    430430|-------------------------------------------------------------------------------
    431431{{{#!td align=left  valign=top
    432 Absence of tag
     432Отсутствие тега
    433433}}}
    434434{{{#!td align=left  valign=top   
     
    457457{{{
    458458#!mapcss
    459 way[!/^addr:/]                    /* matches any way which does not have a tag 'addr:*' */
     459way[!/^addr:/]                    /* соответствует любой линии, не имеющей тега 'addr:*' */
    460460}}}
    461461}}}
     
    465465
    466466{{{#!th align=left valign=top
    467 '''Condition'''
     467'''Условие'''
    468468}}}
    469469{{{#!th align=left valign=top
    470 '''Example'''
     470'''Пример'''
    471471}}}
    472472|-------------------------------------------------------------------------------
     
    491491}}}
    492492
    493 === Territory selector ===
    494 
    495 You can test whether an object is located inside or outside of a specific territory. JOSM has an internal database for this. The territories file is an osm file and can be downloaded [/export/HEAD/josm/trunk/data/boundaries.osm here] and opened in JOSM to investigate it [attachment:boundaries.png (screenshot preview)]. It contains borders of all countries of the world. Due to performance reasons the borders are simplified. They can be refined for special cases on request. The territories are "tagged" with their [https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ISO_3166-1_alpha-2 codes]. USA, Canada, China, India and Australia have additional boundaries for their subdivisions. See the following examples on how to use the territory selectors. Territory selectors are less useful in mappaint styles and can be very resource heavy there. However they are much more useful for [wiki:Help/Validator/MapCSSTagChecker mapcss based validator rules]. To select territories with left-hand-traffic or right-hand-traffic, there is a simpler way, see [#PseudoClasses]. See #10387 for main implementation of this feature.
     493=== Селектор территории ===
     494
     495Можно проверить, располагается объект внутри некоторой территории, или за её пределами. В JOSM есть встроенная база данных для этого. Файл территорий — это osm-файл, его можно скачать  [/export/HEAD/josm/trunk/data/boundaries.osm здесь] и открыть в JOSM для исследования [attachment:wiki:Help/Styles/MapCSSImplementation:boundaries.png (снимок экрана)]. Он содержит границы всех стран мира. Для повышения производительности границы упрощены. В особых случаях они могут быть уточнены по запросу. Территории "тегированы" их [https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 кодами ISO_3166-1_alpha-2]. Для США, Канада, Китай, Индия и Австралия имеются дополнительные границы их территориального деления. Смотрите следующие примеры, как использовать селекторы территории. Territory selectors are less useful in mappaint styles and can be very resource heavy there. However they are much more useful for [wiki:Help/Validator/MapCSSTagChecker mapcss based validator rules]. To select territories with left-hand-traffic or right-hand-traffic, there is a simpler way, see [#PseudoClasses]. See #10387 for main implementation of this feature.
    496496
    497497{{{