Don't count tags under the name namespace as descriptive tags (close #8273)

Don't count `description`, `note`, `start_date`, or tags under those namespaces as descriptive tags
This commit is contained in:
Quincy Morgan
2021-01-05 09:56:19 -05:00
parent 1997aa2193
commit 2c2eabb145

View File

@@ -10,17 +10,18 @@ export function validationMissingTag(context) {
var type = 'missing_tag';
function hasDescriptiveTags(entity, graph) {
var keys = Object.keys(entity.tags)
var onlyDescriptiveKeys = ['description', 'name', 'note', 'start_date'];
var entityDescriptiveKeys = Object.keys(entity.tags)
.filter(function(k) {
if (k === 'area' || k === 'name') {
return false;
} else {
return osmIsInterestingTag(k);
}
if (k === 'area' || !osmIsInterestingTag(k)) return false;
return !onlyDescriptiveKeys.some(function(desciptiveKey) {
return k === desciptiveKey || k.indexOf(desciptiveKey + ':') === 0;
});
});
if (entity.type === 'relation' &&
keys.length === 1 &&
entityDescriptiveKeys.length === 1 &&
entity.tags.type === 'multipolygon') {
// this relation's only interesting tag just says its a multipolygon,
// which is not descriptive enough
@@ -30,7 +31,7 @@ export function validationMissingTag(context) {
return osmOldMultipolygonOuterMemberOfRelation(entity, graph);
}
return keys.length > 0;
return entityDescriptiveKeys.length > 0;
}
function isUnknownRoad(entity) {