This check flags Atlas Area Objects that have conflicting tag combinations. An Atlas Area Object is an enclosed Polygon that (by default) uses this tag filter to differentiate itself from other Atlas Objects.
-
An OSM Editor has mapped this feature (osm id: 372444940) as a building and a tree, using the
nautual=TREE
andbuilding=YES
tags. These two tags should not logically co-exist. An editor should review the feature and make the appropriate changes. -
This closed Way (osm id: 452182969) is tagged as
natural=WATER
andman_made=WATER_TOWER
. Thenatural=WATER
tag should be used to tag areas of water (e.g. lakes, multipolygon water relations), or water bodies. Water towers are man made structures that contain water, therefore, these two should not co-exist.
In Atlas, OSM elements are represented as Edges, Points, Lines, Nodes & Relations; in our case, we’re are looking at Areas.
Our first goal is to validate the incoming Atlas object. Valid features for this check will satisfy the following conditions:
- Must be an Atlas Area Object
- Cannot have an
area=NO
tag.
@Override
public boolean validCheckForObject(final AtlasObject object)
{
return object instanceof Area
&& Validators.isNotOfType(object, AreaTag.class, AreaTag.NO);
}
Using the Validators class, we store each conflicting combination into a Predicate variable that can be used to test its truthiness.
private static final Predicate<Taggable> NATURAL_WATER_MANMANDE = object ->
Validators.isOfType(object, NaturalTag.class, NaturalTag.WATER)
&& Validators.isNotOfType(object, ManMadeTag.class, ManMadeTag.RESERVOIR_COVERED, ManMadeTag.WASTEWATER_PLANT);
For the variable above to be truthy, the following conditions must be true:
- Area has
natural=WATER
tag - Area has a
man_made
tag AND its' value must not equalRESERVOIR_COVERED
ORWASTEWATER_PLANT
Then, we can easily test each combination using Predicate's test()
function.
if (NATURAL_WATER_MANMANDE.test(object))
{
flag.addInstruction(this.getLocalizedInstruction(FOUR));
hasConflictingCombinations = true;
}
To learn more about the code, please look at the comments in the source code for the check. ConflictingAreaTagCombination.java