Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This is a generic check for flagging features using TaggableFilters.
The check uses a configurable list of filters. Each filter has 2 parts. The first is a list of AtlasEntity classes (node, edge, area, etc.). The second is a TaggableFilter. If a feature is one of the classes given and passes the TaggableFilter then it is flagged.
The TaggableFilter is also used to generate the instructions for a flag. For each TaggableFilter that an object passes an instruction is added to the flag. The instruction uses the tag keys from the TaggableFilter to give guidance on what the problem is.
There is currently only one filter for this check. It is described in the filter example below.
Filter Example:
Areas and Relations with the tag
boundary=protected_area
should have aprotect_class
tag.A filter to flag this would look like the following:
["area,relation","boundary->protected_area&protect_class->!"]
The first string is a list of the 2 AtlasEntity classes we want to look for. The second string is the TaggableFilter that is looking for the combination of
boundary=protected_area
without aprotect_class
tag.This would flag an osm feature like the following: Way 673787307.
The instruction for flags produced by this filter would look like:
Check the following tags for missing, conflicting, or incorrect values: boundary, protect_class
Potential Impact:
This check is similar to ConflictingTagCombinationCheck and ConflictingAreaTagCombination, but more generic. It is possible that those checks could at a later date be absorbed into this check.
Unit Test Approach:
Unit test check a number of combinations for each part of the configurable filter system. Multiple AtlasObject classes and TaggableFilters are tested. There is also a test for the dynamic instructions.
Test Results:
Tested in 7 countries and sampled 129 flags. All flags were true positive cases.