public class Coastlines extends Test
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private java.util.List<Way> |
coastlineWays |
protected static int |
REVERSED_COASTLINE |
protected static int |
UNCONNECTED_COASTLINE |
protected static int |
UNORDERED_COASTLINE |
protected static int |
WRONG_ORDER_COASTLINE |
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
Coastlines()
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
addError(int errCode,
Way w,
java.util.Collection<Way> otherWays,
Node n)
Add error if not already done
|
private void |
checkConnections()
Check connections between coastline ways.
|
private void |
checkDirection()
Check if two or more coastline ways form a closed clockwise way
|
private void |
checkIfReversed(Way w,
Way other,
Node n1)
Check if a reversed way would fit, if yes, add fixable "reversed" error, "unordered" else
|
void |
endTest()
Notification of the end of the test.
|
Command |
fixError(TestError testError)
Fixes the error with the appropriate command
|
private static boolean |
isCoastline(OsmPrimitive osm) |
boolean |
isFixable(TestError testError)
Returns true if the given error can be fixed automatically
|
void |
startTest(ProgressMonitor monitor)
Start the test using a given progress monitor
|
void |
visit(Way way)
Visiting call for lines.
|
addGui, clear, deletePrimitivesIfNeeded, getErrors, getName, initialize, isBuilding, isCanceled, isPrimitiveUsable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit, visit, visit
protected static final int UNORDERED_COASTLINE
protected static final int REVERSED_COASTLINE
protected static final int UNCONNECTED_COASTLINE
protected static final int WRONG_ORDER_COASTLINE
private java.util.List<Way> coastlineWays
public Coastlines()
public void startTest(ProgressMonitor monitor)
Test
public void endTest()
Test
If you override this method, don't forget to cleanup progressMonitor
(most overrides call super.endTest()
to do this).
private void checkConnections()
private void checkDirection()
private void checkIfReversed(Way w, Way other, Node n1)
w
- way that might be reversedother
- other way that is connected to wn1
- node at which w and other are connectedprivate void addError(int errCode, Way w, java.util.Collection<Way> otherWays, Node n)
errCode
- the error codew
- the way that is in errorotherWays
- collection of other ways in error or nulln
- the node to be highlighted or nullpublic void visit(Way way)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
way
- The way to inspect.private static boolean isCoastline(OsmPrimitive osm)
public Command fixError(TestError testError)
Test