-
Notifications
You must be signed in to change notification settings - Fork 8
/
kaart.ref.validator.mapcss
37 lines (34 loc) · 1.54 KB
/
kaart.ref.validator.mapcss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
meta
{
title: "Road Ref Validations";
description: "Check for road ref inconsistencies";
author: "Taylor Smock";
min-josm-version: "15282";
version: "10_2020-10-16";
}
/*************
* refs *******
*************/
/*
@supports (min-josm-version: 15323) {
/* Check for ways that don't have the parent relation ref */
/*
relation[type=route][route=road][ref] > way[ref][!regexp_test(concat("^(", join_list("|", uniq_list(split(";", join(";", tag_regex("ref"))))), "|;?)+$"), join_list(";", uniq_list(sort_list(parent_tags("ref")))), "i")] {
group: tr("kaart");
throwWarning: tr("Parent ref not in child ref");
set .parent_ref_not_in_child_ref;
}
/* Check for ways that have a ref that is not in a parent */
/*
relation[type=route][route=road] > way[highway][ref][count(parent_tags("ref")) != 0 && !regexp_test(join_list(";", uniq_list(sort_list(split(";", join_list(";", tag_regex("^(ref|nat_ref|int_ref|reg_ref)$")))))), join_list(";", uniq_list(sort_list(parent_tags("ref")))), "i")]!.parent_ref_not_in_child_ref {
group: tr("kaart");
throwWarning: tr("A ref on a way is not in a parent relation");
set .ref_not_in_relation
}
} */
/* Find ways that are missing the parent relation ref or have a different ref than the parent relation */
/* Derek Bevan */
way[highway =~ /(tertiary|secondary|primary|trunk|motorway)/][JOSM_search("type:way child(type:relation route=road ref)")][(parent_tag("ref") != tag("ref")) || JOSM_search("-ref")] {
group: tr("kaart");
throwOther: tr("Ref on route relation may hint at missing highway refs");
}