diff --git a/data/defaultpresets.xml b/data/defaultpresets.xml
index db9d63a..51ad2fc 100755
|
a
|
b
|
check: checkbox
|
| 78 | 78 | value_off: the value to set when unchecked (default is 'no') |
| 79 | 79 | |
| 80 | 80 | role: type to specify possible roles in relations |
| 81 | | key: the role name used in relation |
| | 81 | key: comma separated list of role names used in relation |
| 82 | 82 | text: fixed label to display |
| 83 | 83 | requisite: "optional" or "required" (default is optional) |
| 84 | 84 | count: how often can the role occur (if not given unlimited number is assumed) |
| … |
… |
are supplied, then "values" will be treated as "display_values" and translated i
|
| 4160 | 4160 | </optional> |
| 4161 | 4161 | <roles> |
| 4162 | 4162 | <role key="" text="route segment" requisite="optional" type="way" /> |
| 4163 | | <role key="forward" text="forward segment" requisite="optional" type="way" /> |
| 4164 | | <role key="backward" text="backward segment" requisite="optional" type="way" /> |
| | 4163 | <role key="forward,backward" text="forward/backward segment" requisite="optional" type="way" /> |
| 4165 | 4164 | <role key="stop" text="halt point" requisite="optional" type="node" /> |
| 4166 | | <role key="forward_stop" text="forward halt point" requisite="optional" type="node" /> |
| 4167 | | <role key="backward_stop" text="backward halt point" requisite="optional" type="node" /> |
| | 4165 | <role key="forward_stop,backward_stop" text="forward/backward_stop halt point" requisite="optional" type="node" /> |
| | 4166 | <role key="north,south,east,west" text="(for North America)" requisite="optional" type="way" /> |
| 4168 | 4167 | </roles> |
| 4169 | 4168 | </item> |
| 4170 | 4169 | <item name="Route network" icon="presets/path.png" type="relation"> |
diff --git a/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java b/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
index 7279e34..a7fc790 100644
|
a
|
b
|
public class RelationChecker extends Test {
|
| 109 | 109 | RoleInfo ri = map.get(s); |
| 110 | 110 | if (ri == null) { |
| 111 | 111 | ri = new RoleInfo(); |
| | 112 | map.put(s, ri); |
| 112 | 113 | } |
| 113 | 114 | ri.total++; |
| 114 | 115 | if (m.isRelation()) { |
| … |
… |
public class RelationChecker extends Test {
|
| 124 | 125 | else if (m.isNode()) { |
| 125 | 126 | ri.nodes++; |
| 126 | 127 | } |
| 127 | | map.put(s, ri); |
| 128 | 128 | } |
| 129 | 129 | if(map.isEmpty()) { |
| 130 | 130 | errors.add( new TestError(this, Severity.ERROR, tr("Relation is empty"), |
| … |
… |
public class RelationChecker extends Test {
|
| 132 | 132 | } else { |
| 133 | 133 | LinkedList<String> done = new LinkedList<String>(); |
| 134 | 134 | for (TaggingPreset.Role r : allroles) { |
| 135 | | done.add(r.key); |
| 136 | | String keyname = r.key; |
| | 135 | for (String keyname : r.key.split(",")) { |
| | 136 | keyname = keyname.trim(); |
| | 137 | done.add(keyname); |
| | 138 | RoleInfo ri = map.get(keyname); |
| 137 | 139 | if ("".equals(keyname)) { |
| 138 | 140 | keyname = tr("<empty>"); |
| 139 | 141 | } |
| 140 | | RoleInfo ri = map.get(r.key); |
| 141 | 142 | long count = (ri == null) ? 0 : ri.total; |
| 142 | 143 | long vc = r.getValidCount(count); |
| 143 | 144 | if (count != vc) { |
| … |
… |
public class RelationChecker extends Test {
|
| 164 | 165 | tr(s, keyname), MessageFormat.format(s, keyname), WRONG_TYPE, n) ); |
| 165 | 166 | } |
| 166 | 167 | } |
| | 168 | } |
| 167 | 169 | for (String key : map.keySet()) { |
| 168 | 170 | if (!done.contains(key)) { |
| 169 | 171 | if (key.length() > 0) { |