Class DuplicateNode
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.Test
-
- org.openstreetmap.josm.data.validation.tests.DuplicateNode
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
public class DuplicateNode extends Test
Tests if there are duplicate nodes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DuplicateNode.NodeHash
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DUPLICATE_NODE
protected static int
DUPLICATE_NODE_BOUNDARY
protected static int
DUPLICATE_NODE_BUILDING
protected static int
DUPLICATE_NODE_HIGHWAY
protected static int
DUPLICATE_NODE_LANDUSE
protected static int
DUPLICATE_NODE_MIXED
protected static int
DUPLICATE_NODE_NATURAL
protected static int
DUPLICATE_NODE_OTHER
protected static int
DUPLICATE_NODE_POWER
protected static int
DUPLICATE_NODE_RAILWAY
protected static int
DUPLICATE_NODE_WATERWAY
private Storage<java.lang.Object>
potentialDuplicates
The map of potential duplicates.private static java.lang.String[]
TYPES
-
Fields 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 Constructor Description DuplicateNode()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<TestError>
buildTestErrors(Test parentTest, java.util.List<Node> nodes)
Returns the list of "duplicate nodes" errors for the given selection of node and parent testvoid
endTest()
Notification of the end of the test.Command
fixError(TestError testError)
Merge the nodes into one.boolean
isFixable(TestError testError)
Returns true if the given error can be fixed automaticallyvoid
startTest(ProgressMonitor monitor)
Start the test using a given progress monitorvoid
visit(Node n)
Visiting call for points.-
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 Detail
-
DUPLICATE_NODE
protected static final int DUPLICATE_NODE
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_MIXED
protected static final int DUPLICATE_NODE_MIXED
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_OTHER
protected static final int DUPLICATE_NODE_OTHER
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_BUILDING
protected static final int DUPLICATE_NODE_BUILDING
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_BOUNDARY
protected static final int DUPLICATE_NODE_BOUNDARY
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_HIGHWAY
protected static final int DUPLICATE_NODE_HIGHWAY
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_LANDUSE
protected static final int DUPLICATE_NODE_LANDUSE
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_NATURAL
protected static final int DUPLICATE_NODE_NATURAL
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_POWER
protected static final int DUPLICATE_NODE_POWER
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_RAILWAY
protected static final int DUPLICATE_NODE_RAILWAY
- See Also:
- Constant Field Values
-
DUPLICATE_NODE_WATERWAY
protected static final int DUPLICATE_NODE_WATERWAY
- See Also:
- Constant Field Values
-
TYPES
private static final java.lang.String[] TYPES
-
potentialDuplicates
private Storage<java.lang.Object> potentialDuplicates
The map of potential duplicates. If there is exactly one node for a given pos, the map includes a pair <pos, Node>. If there are multiple nodes for a given pos, the map includes a pair <pos, List<Node>>
-
-
Constructor Detail
-
DuplicateNode
public DuplicateNode()
Constructor
-
-
Method Detail
-
startTest
public void startTest(ProgressMonitor monitor)
Description copied from class:Test
Start the test using a given 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
progressMonitor
(most overrides callsuper.endTest()
to do this).
-
buildTestErrors
public java.util.List<TestError> buildTestErrors(Test parentTest, java.util.List<Node> nodes)
Returns the list of "duplicate nodes" errors for the given selection of node and parent test- Parameters:
parentTest
- The parent test of returned errorsnodes
- The nodes selection to look into- Returns:
- the list of "duplicate nodes" errors
-
visit
public void visit(Node n)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for points.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Overrides:
visit
in classTest
- Parameters:
n
- The node to inspect.
-
fixError
public Command fixError(TestError testError)
Merge the nodes into one. Copied from UtilsPlugin.MergePointsAction
-
-