Class Coastlines
java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.Coastlines
- All Implemented Interfaces:
OsmPrimitiveVisitor
Check coastlines for errors
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intFields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, stopwatch, testBeforeUpload -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddError(int errCode, Way w, Collection<Way> otherWays, Node n) Add error if not already doneprivate voidCheck connections between coastline ways.private voidCheck if two or more coastline ways form a closed clockwise wayprivate voidcheckIfReversed(Way w, Way other, Node n1) Check if a reversed way would fit, if yes, add fixable "reversed" error, "unordered" elsevoidendTest()Notification of the end of the test.Fixes the error with the appropriate commandprivate static booleanisCoastline(OsmPrimitive osm) booleanReturns true if the given error can be fixed automaticallyvoidstartTest(ProgressMonitor monitor) Start the test using a given progress monitorvoidVisiting call for lines.Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, clear, deletePrimitivesIfNeeded, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isPrimitiveUsable, isResidentialArea, ok, removeIrrelevantErrors, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit, visit, visit
-
Field Details
-
UNORDERED_COASTLINE
- See Also:
-
REVERSED_COASTLINE
- See Also:
-
UNCONNECTED_COASTLINE
- See Also:
-
WRONG_ORDER_COASTLINE
- See Also:
-
coastlineWays
-
-
Constructor Details
-
Coastlines
public Coastlines()Constructor
-
-
Method Details
-
startTest
Description copied from class:TestStart the test using a given progress monitor -
endTest
Description copied from class:TestNotification of the end of the test. The tester may perform additional actions and destroy the used structures.If you override this method, don't forget to cleanup
progressMonitor(most overrides callsuper.endTest()to do this). -
checkConnections
Check connections between coastline ways. The nodes of a coastline way have to fulfil these rules: 1) the first node must be connected to the last node of a coastline way (which might be the same way) 2) the last node must be connected to the first node of a coastline way (which might be the same way) 3) all other nodes must not be connected to a coastline way 4) the number of referencing coastline ways must be 1 or 2 Nodes outside the download area are special cases, we may not know enough about the connected ways. -
checkDirection
Check if two or more coastline ways form a closed clockwise way -
checkIfReversed
Check if a reversed way would fit, if yes, add fixable "reversed" error, "unordered" else- Parameters:
w- way that might be reversedother- other way that is connected to wn1- node at which w and other are connected
-
addError
Add error if not already done- Parameters:
errCode- the error codew- the way that is in errorotherWays- collection of other ways in error or nulln- the node to be highlighted or null
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
way- The way to inspect.
-
isCoastline
-
fixError
Description copied from class:TestFixes the error with the appropriate command -
isFixable
Description copied from class:TestReturns true if the given error can be fixed automatically
-