Class WaterWayCheck
- java.lang.Object
-
- org.openstreetmap.atlas.checks.base.BaseCheck<java.lang.Long>
-
- org.openstreetmap.atlas.checks.validation.linear.lines.WaterWayCheck
-
- All Implemented Interfaces:
java.io.Serializable,Check
public class WaterWayCheck extends BaseCheck<java.lang.Long>
This check flags waterways that do not have a sink (i.e., are not connected to another waterway), are circular (so first node and last node are the same), or cross another waterway with the same layer. It also looks for ways that may be going uphill (requires elevation data, seeElevationUtilities- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.atlas.checks.base.BaseCheck
PARAMETER_ACCEPT_PIERS, PARAMETER_CHALLENGE, PARAMETER_DENYLIST_COUNTRIES, PARAMETER_FLAG, PARAMETER_PERMITLIST_COUNTRIES, PARAMETER_PERMITLIST_TAGS, PARAMETER_USE_EXTERNAL_DATA
-
-
Constructor Summary
Constructors Constructor Description WaterWayCheck(org.openstreetmap.atlas.utilities.configuration.Configuration configuration, ExternalDataFetcher fileFetcher)Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoesLineEndInOcean(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.atlas.items.LineItem line)Check if a line ends in an oceanbooleandoesLineEndInSink(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.atlas.items.LineItem lineItem)Check if a line ends in a waterway sinkbooleandoesLineEndOnWaterway(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.atlas.items.LineItem line)Check if the last location on a line also happens to be connected to a waterway.protected java.util.Optional<CheckFlag>flag(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object)protected java.util.List<java.lang.String>getFallbackInstructions()Method to implement for inheriting checks to return the default set of instruction formats that will be the last resort inBaseCheck.getLocalizedInstruction(int, Object[])static java.util.Collection<org.apache.commons.lang3.tuple.Pair<org.openstreetmap.atlas.geography.Segment,org.openstreetmap.atlas.geography.Segment>>getIntersectingSegments(org.openstreetmap.atlas.geography.PolyLine left, org.openstreetmap.atlas.geography.PolyLine right)Get intersecting segments of two polylinesbooleanisRightOf(org.openstreetmap.atlas.geography.PolyLine line, org.openstreetmap.atlas.geography.Location location)Check if a location is to the right of a line (e.g., kerbs, cliffs, and oceans)booleanisValidEndToCheck(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.Location location)Check if a location is inside an atlas boundsbooleanvalidCheckForObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object)Checks to see whether the supplied object class type is valid for this particular check-
Methods inherited from class org.openstreetmap.atlas.checks.base.BaseCheck
acceptPier, check, checkObjectFilter, clear, clearFlaggedIdentifiers, configurationKey, configurationKey, configurationValue, configurationValue, createFlag, createFlag, createFlag, createFlag, createFlag, createFlag, createFlag, createFlag, flags, getChallenge, getCheckName, getCheckPolygonFilter, getCountries, getDenylistCountries, getFlaggedIdentifiers, getGlobalPolygonFilter, getLocale, getLocalizedInstruction, getTaskIdentifier, getTaskIdentifier, getUniqueObjectIdentifier, getUniqueOSMIdentifier, isFlagged, logStatus, markAsFlagged, useExternalData, validCheckForCountry
-
-
-
-
Constructor Detail
-
WaterWayCheck
public WaterWayCheck(org.openstreetmap.atlas.utilities.configuration.Configuration configuration, ExternalDataFetcher fileFetcher)Default constructor- Parameters:
configuration- the JSON configuration for this checkfileFetcher- The file fetcher to use to get data files
-
-
Method Detail
-
getIntersectingSegments
public static java.util.Collection<org.apache.commons.lang3.tuple.Pair<org.openstreetmap.atlas.geography.Segment,org.openstreetmap.atlas.geography.Segment>> getIntersectingSegments(org.openstreetmap.atlas.geography.PolyLine left, org.openstreetmap.atlas.geography.PolyLine right)Get intersecting segments of two polylines- Parameters:
left- The polyline whose segments will go in the key/left side of the pairright- The polyline whose segments will go in the value/right side of the pair- Returns:
- A collection of segments intersecting other segments. A segment *may* appear more than once.
-
doesLineEndInOcean
public boolean doesLineEndInOcean(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.atlas.items.LineItem line)Check if a line ends in an ocean- Parameters:
atlas- The atlas of the objectline- The line to check- Returns:
trueif the line ends in an ocean
-
doesLineEndInSink
public boolean doesLineEndInSink(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.atlas.items.LineItem lineItem)Check if a line ends in a waterway sink- Parameters:
atlas- The atlas of the objectlineItem- The LineItem to check- Returns:
trueif the waterway can reasonably be expected to end
-
doesLineEndOnWaterway
public boolean doesLineEndOnWaterway(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.atlas.items.LineItem line)Check if the last location on a line also happens to be connected to a waterway.- Parameters:
atlas- The atlas of the objectline- The line to check- Returns:
trueif the line ends on a waterway (the last node is part of a waterway)
-
isRightOf
public boolean isRightOf(org.openstreetmap.atlas.geography.PolyLine line, org.openstreetmap.atlas.geography.Location location)Check if a location is to the right of a line (e.g., kerbs, cliffs, and oceans)- Parameters:
line- The line to compare the location tolocation- The location- Returns:
trueif the location is to the right of the line. If the location is on the line, or to the left of the line, we returnfalse.
-
isValidEndToCheck
public boolean isValidEndToCheck(org.openstreetmap.atlas.geography.atlas.Atlas atlas, org.openstreetmap.atlas.geography.Location location)Check if a location is inside an atlas bounds- Parameters:
atlas- The atlaslocation- The location to check- Returns:
trueif the atlas contains the location inside its bounds
-
validCheckForObject
public boolean validCheckForObject(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object)
Description copied from interface:CheckChecks to see whether the supplied object class type is valid for this particular check- Parameters:
object- TheAtlasObjectyou are checking- Returns:
- true if it is
-
flag
protected java.util.Optional<CheckFlag> flag(org.openstreetmap.atlas.geography.atlas.items.AtlasObject object)
-
getFallbackInstructions
protected java.util.List<java.lang.String> getFallbackInstructions()
Description copied from class:BaseCheckMethod to implement for inheriting checks to return the default set of instruction formats that will be the last resort inBaseCheck.getLocalizedInstruction(int, Object[])- Overrides:
getFallbackInstructionsin classBaseCheck<java.lang.Long>- Returns:
- The set of instructions to fall back to if configuration results in none.
-
-