Skip to content

Commit d7d02cb

Browse files
committed
move tag list into osm/tags.js
1 parent ec63bcc commit d7d02cb

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

modules/osm/tags.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,15 @@ export function isColourValid(value) {
255255
}
256256
return true;
257257
}
258+
259+
// https://wiki.openstreetmap.org/wiki/Special:WhatLinksHere/Property:P44
260+
export var osmMutuallyExclusiveTagPairs = [
261+
['noname', 'name'],
262+
['noref', 'ref'],
263+
['nohousenumber', 'addr:housenumber'],
264+
['noaddress', 'addr:housenumber'],
265+
['noaddress', 'addr:housename'],
266+
['noaddress', 'addr:unit'],
267+
['addr:nostreet', 'addr:street']
268+
];
269+

modules/validations/mutually_exclusive_tags.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@ import { actionChangeTags } from '../actions/change_tags';
22
import { t } from '../core/localizer';
33
import { utilDisplayLabel } from '../util';
44
import { validationIssue, validationIssueFix } from '../core/validation';
5+
import { osmMutuallyExclusiveTagPairs } from '../osm/tags';
56

67
export function validationMutuallyExclusiveTags(/* context */) {
78
const type = 'mutually_exclusive_tags';
89

910
// https://wiki.openstreetmap.org/wiki/Special:WhatLinksHere/Property:P44
10-
const tagKeyPairs = [
11-
['noname', 'name'],
12-
['noref', 'ref'],
13-
['nohousenumber', 'addr:housenumber'],
14-
['noaddress', 'addr:housenumber'],
15-
['noaddress', 'addr:housename'],
16-
['noaddress', 'addr:unit'],
17-
['addr:nostreet', 'addr:street']
18-
];
11+
const tagKeyPairs = osmMutuallyExclusiveTagPairs;
1912

2013
const validation = function checkMutuallyExclusiveTags(entity /*, graph */) {
2114

0 commit comments

Comments
 (0)