org.openstreetmap.josm.data.validation.tests
Class Coastlines

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.Test
          extended by org.openstreetmap.josm.data.validation.tests.Coastlines
All Implemented Interfaces:
Visitor

public class Coastlines
extends Test

Check coastlines for errors


Field Summary
private  java.util.List<Way> coastlines
           
private  java.awt.geom.Area downloadedArea
           
protected static int REVERSED_COASTLINE
           
protected static int UNCONNECTED_COASTLINE
           
protected static int UNORDERED_COASTLINE
           
 
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload
 
Constructor Summary
Coastlines()
          Constructor
 
Method Summary
 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.
 
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, deletePrimitivesIfNeeded, getErrors, getName, initialize, isBuilding, isCanceled, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit, visit
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNORDERED_COASTLINE

protected static final int UNORDERED_COASTLINE
See Also:
Constant Field Values

REVERSED_COASTLINE

protected static final int REVERSED_COASTLINE
See Also:
Constant Field Values

UNCONNECTED_COASTLINE

protected static final int UNCONNECTED_COASTLINE
See Also:
Constant Field Values

coastlines

private java.util.List<Way> coastlines

downloadedArea

private java.awt.geom.Area downloadedArea
Constructor Detail

Coastlines

public Coastlines()
Constructor

Method Detail

startTest

public void startTest(ProgressMonitor monitor)
Description copied from class: Test
Start the test using a given progress monitor

Overrides:
startTest in class Test
Parameters:
monitor - the progress monitor

endTest

public void endTest()
Description copied from class: Test
Notification 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 Test.progressMonitor (most overrides call super.endTest() to do this).

Overrides:
endTest in class Test

visit

public void visit(Way way)
Description copied from interface: Visitor
Visiting call for lines.

Specified by:
visit in interface Visitor
Overrides:
visit in class Test
Parameters:
way - The way to inspect.

isCoastline

private static boolean isCoastline(OsmPrimitive osm)

fixError

public Command fixError(TestError testError)
Description copied from class: Test
Fixes the error with the appropriate command

Overrides:
fixError in class Test
Returns:
The command to fix the error

isFixable

public boolean isFixable(TestError testError)
Description copied from class: Test
Returns true if the given error can be fixed automatically

Overrides:
isFixable in class Test
Parameters:
testError - The error to check if can be fixed
Returns:
true if the error can be fixed


JOSM