Only expand a validation set to include parent multipolygon relations

The previous code was grabbing _all_ parent relations, which is too much.
For example: if a user changed a road, the validator was treating it like
the user had changed bus and highway routes along that road.

(closes #8613)
(helps a lot #8612)
This commit is contained in:
Bryan Housel
2021-08-05 14:49:14 -04:00
parent 3b0a850400
commit a46a345647
+6 -2
View File
@@ -650,7 +650,7 @@ export function coreValidator(context) {
checkParentRels.push(parentWay);
});
} else if (entity.type === 'relation') {
} else if (entity.type === 'relation' && entity.isMultipolygon()) {
entity.members.forEach(member => collected.add(member.id)); // collect members
} else if (entity.type === 'way') {
@@ -662,7 +662,11 @@ export function coreValidator(context) {
checkParentRels.forEach(entity => { // collect parent relations
if (entity.type !== 'relation') { // but not super-relations
graph.parentRelations(entity).forEach(parentRelation => collected.add(parentRelation.id));
graph.parentRelations(entity).forEach(parentRelation => {
if (parentRelation.isMultipolygon()) {
collected.add(parentRelation.id);
}
});
}
});
});