source: josm/trunk/resources/data/validator/addresses.mapcss@ 18544

Last change on this file since 18544 was 17759, checked in by simon04, 4 years ago

fix #20751 - Add MapCSS function mod (modulo)

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1/* #10232 */
2way[addr:interpolation=odd] > node[addr:housenumber][mod(tag("addr:housenumber"),2)=0] {
3 throwWarning: tr("Even housenumber in odd address interpolation.");
4}
5way[addr:interpolation=even] > node[addr:housenumber][mod(tag("addr:housenumber"),2)=1] {
6 throwWarning: tr("Odd housenumber in even address interpolation.");
7}
8way[addr:interpolation] {
9 throwOther: tr("Way with {0}. Tag each housenumber separately if possible.", "{0.key}");
10}
11
12/* #19393 */
13way[addr:interpolation] >[index= 1] node[!addr:housenumber],
14way[addr:interpolation] >[index=-1] node[!addr:housenumber] {
15 throwWarning: tr("End node without housenumber in address interpolation.");
16}
17
18/* #13752 */
19*[!addr:housenumber][addr:street][addr:housename=~/^[0-9]+[a-zA-Z]?$/] {
20 throwOther: tr("Object has no {0}, however, it has {1} and {2} whose value looks like a housenumber.", "{0.key}", "{1.key}", "{2.key}");
21 assertMatch: "node addr:street=foo addr:housename=1";
22 assertMatch: "node addr:street=foo addr:housename=1a";
23 assertMatch: "node addr:street=foo addr:housename=221B";
24 assertNoMatch: "node addr:street=foo addr:housename=1 addr:housenumber=1";
25 assertNoMatch: "node addr:housename=1";
26 assertNoMatch: "node addr:street=foo addr:housename=bar";
27}
28*[addr:housenumber][addr:housename]["addr:housenumber"=*"addr:housename"] {
29 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
30 assertMatch: "node addr:housename=1 addr:housenumber=1";
31 assertNoMatch: "node addr:housename=1 addr:housenumber=2";
32}
33
34/* #17486 */
35*[addr:housenumber=bb][inside("BA")] {
36 set ok_housenumber;
37}
38*[addr:housenumber][addr:housenumber!~/[0-9]/]!.ok_housenumber {
39 throwWarning: tr("{0} without number", "{0.key}");
40 assertNoMatch: "way addr:housenumber=0";
41 assertNoMatch: "way addr:housenumber=5a";
42 assertNoMatch: "way addr:housenumber=5/1";
43 assertMatch: "way addr:housenumber=?";
44 assertMatch: "way addr:housenumber=unknown";
45 assertMatch: "way addr:housenumber=Palace of Westminster";
46 assertMatch: "way addr:housenumber=S/N";
47}
Note: See TracBrowser for help on using the repository browser.