Class CheckFlag
- java.lang.Object
-
- org.openstreetmap.atlas.checks.flag.CheckFlag
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<org.openstreetmap.atlas.geography.Location>,org.openstreetmap.atlas.geography.Located
public class CheckFlag extends java.lang.Object implements java.lang.Iterable<org.openstreetmap.atlas.geography.Location>, org.openstreetmap.atlas.geography.Located, java.io.SerializableACheckFlagis used to flag one or moreAtlasObjects found to violate some set of rules.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CheckFlag(java.lang.String identifier)A basic constructor that simply flags some identifying valueCheckFlag(java.lang.String identifier, java.util.Set<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> objects, java.util.List<java.lang.String> instructions)Creates aCheckFlagwith a set ofAtlasObjects to flag, most commonly used when all of theAtlasObjects contribute to the rule violationCheckFlag(java.lang.String identifier, java.util.Set<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> objects, java.util.List<java.lang.String> instructions, java.util.List<org.openstreetmap.atlas.geography.Location> points)Creates aCheckFlagwith the addition of a list ofpointLocations that highlight specific points in the geometry that caused the rule violation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInstruction(java.lang.String instruction)Adds any instructions that may help communicate why theAtlasObject(s) were flaggedvoidaddInstructions(java.lang.Iterable<java.lang.String> instructions)Adds a list of instructions that may help communicate why theAtlasObject(s) were flagged.voidaddObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object)Adds anAtlasObjectto flagvoidaddObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object, java.lang.String instruction)Flags anAtlasObjectwith instructions.voidaddObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object, org.openstreetmap.atlas.geography.Location point, java.lang.String instruction)Flags anAtlasObject, highlighting a specificpointLocationand instructions with more detail.voidaddObjects(java.lang.Iterable<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> objects)Adds a list ofAtlasObjects to flagvoidaddPoint(org.openstreetmap.atlas.geography.Location point)Flags a specificLocationvoidaddPoints(java.lang.Iterable<org.openstreetmap.atlas.geography.Location> points)Flags a list ofpointLocationscom.google.gson.JsonObjectasGeoJsonFeature()org.openstreetmap.atlas.geography.Rectanglebounds()booleanequals(java.lang.Object other)java.util.Optional<java.lang.String>getChallengeName()java.lang.StringgetCountryISO()Will return the first country ISO that it finds in the objects provided in the flagjava.util.Set<FlaggedObject>getFlaggedObjects()java.util.Set<FlaggedObject>getFlaggedRelations()java.util.List<org.openstreetmap.atlas.geography.geojson.GeoJsonBuilder.GeometryWithProperties>getGeometryWithProperties()java.lang.StringgetIdentifier()java.lang.StringgetInstructions()TaskgetMapRouletteTask()java.util.Set<org.openstreetmap.atlas.geography.Location>getPoints()java.util.Set<org.openstreetmap.atlas.geography.PolyLine>getPolyLines()java.lang.Iterable<java.lang.Iterable<org.openstreetmap.atlas.geography.Location>>getShapes()inthashCode()java.util.Iterator<org.openstreetmap.atlas.geography.Location>iterator()voidsave(org.openstreetmap.atlas.streaming.resource.WritableResource writableResource)Writes the string value of thisCheckFlagto theWritableResourcevoidsetChallengeName(java.lang.String challengeName)Sets a Challenge name for this Flagjava.lang.StringtoString()
-
-
-
Constructor Detail
-
CheckFlag
public CheckFlag(java.lang.String identifier)
A basic constructor that simply flags some identifying value- Parameters:
identifier- the identifying value to flag
-
CheckFlag
public CheckFlag(java.lang.String identifier, java.util.Set<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> objects, java.util.List<java.lang.String> instructions)Creates aCheckFlagwith a set ofAtlasObjects to flag, most commonly used when all of theAtlasObjects contribute to the rule violation- Parameters:
identifier- the identifying value to flagobjects-AtlasObjects to flaginstructions- a list of free form instructions
-
CheckFlag
public CheckFlag(java.lang.String identifier, java.util.Set<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> objects, java.util.List<java.lang.String> instructions, java.util.List<org.openstreetmap.atlas.geography.Location> points)Creates aCheckFlagwith the addition of a list ofpointLocations that highlight specific points in the geometry that caused the rule violation- Parameters:
identifier- the identifying value to flagobjects-AtlasObjects to flaginstructions- a list of free form instructionspoints-pointLocations to highlight
-
-
Method Detail
-
addInstruction
public void addInstruction(java.lang.String instruction)
Adds any instructions that may help communicate why theAtlasObject(s) were flagged- Parameters:
instruction- a free form instruction
-
addInstructions
public void addInstructions(java.lang.Iterable<java.lang.String> instructions)
Adds a list of instructions that may help communicate why theAtlasObject(s) were flagged. This can be useful if multiple rules were violated- Parameters:
instructions- a list of free form instruction
-
addObject
public void addObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object)
Adds anAtlasObjectto flag- Parameters:
object- anAtlasObject
-
addObject
public void addObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object, org.openstreetmap.atlas.geography.Location point, java.lang.String instruction)Flags anAtlasObject, highlighting a specificpointLocationand instructions with more detail. This helps build flags iteratively when more complexChecks span a large number ofAtlasObjects.- Parameters:
object- theAtlasObjectto flagpoint- thepointLocationto highlightinstruction- a free form instruction
-
addObject
public void addObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object, java.lang.String instruction)Flags anAtlasObjectwith instructions. This helps build flags iteratively when more complexChecks span a large number ofAtlasObjects- Parameters:
object- theAtlasObjectto flaginstruction- a free form instruction
-
addObjects
public void addObjects(java.lang.Iterable<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> objects)
Adds a list ofAtlasObjects to flag- Parameters:
objects- a list ofAtlasObjects
-
addPoint
public void addPoint(org.openstreetmap.atlas.geography.Location point)
Flags a specificLocation- Parameters:
point- thepointLocationto flag
-
addPoints
public void addPoints(java.lang.Iterable<org.openstreetmap.atlas.geography.Location> points)
Flags a list ofpointLocations- Parameters:
points- thepointLocations to flag
-
asGeoJsonFeature
public com.google.gson.JsonObject asGeoJsonFeature()
-
bounds
public org.openstreetmap.atlas.geography.Rectangle bounds()
- Specified by:
boundsin interfaceorg.openstreetmap.atlas.geography.Located
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getChallengeName
public java.util.Optional<java.lang.String> getChallengeName()
- Returns:
- a Challenge name
-
getCountryISO
public java.lang.String getCountryISO()
Will return the first country ISO that it finds in the objects provided in the flag- Returns:
- a country ISO3 code
-
getFlaggedObjects
public java.util.Set<FlaggedObject> getFlaggedObjects()
- Returns:
- a set of flagged
AtlasObjects
-
getFlaggedRelations
public java.util.Set<FlaggedObject> getFlaggedRelations()
- Returns:
- a set of flagged
Relations
-
getGeometryWithProperties
public java.util.List<org.openstreetmap.atlas.geography.geojson.GeoJsonBuilder.GeometryWithProperties> getGeometryWithProperties()
- Returns:
- a list of
GeoJsonBuilder.GeometryWithPropertiesrepresenting all flagged geometries
-
getIdentifier
public java.lang.String getIdentifier()
- Returns:
- the flag identifier
-
getInstructions
public java.lang.String getInstructions()
- Returns:
- all of the instructions in a
String
-
getPoints
public java.util.Set<org.openstreetmap.atlas.geography.Location> getPoints()
- Returns:
- a set of all
pointLocationgeometries flagged
-
getPolyLines
public java.util.Set<org.openstreetmap.atlas.geography.PolyLine> getPolyLines()
- Returns:
- a set of all
polylinegeometries flagged
-
getShapes
public java.lang.Iterable<java.lang.Iterable<org.openstreetmap.atlas.geography.Location>> getShapes()
- Returns:
- a
shaperepresentation of allpolylinegeometries flagged
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
iterator
public java.util.Iterator<org.openstreetmap.atlas.geography.Location> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<org.openstreetmap.atlas.geography.Location>
-
save
public void save(org.openstreetmap.atlas.streaming.resource.WritableResource writableResource)
Writes the string value of thisCheckFlagto theWritableResource- Parameters:
writableResource- aWritableResourceto write to
-
setChallengeName
public void setChallengeName(java.lang.String challengeName)
Sets a Challenge name for this Flag- Parameters:
challengeName- a Challenge name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-