Skip to content

Commit

Permalink
Only expand a validation set to include parent multipolygon relations
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bhousel committed Aug 5, 2021
1 parent 3b0a850 commit a46a345
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/core/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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);
}
});
}
});
});
Expand Down

0 comments on commit a46a345

Please sign in to comment.