Class DuplicateRelation
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.Test
-
- org.openstreetmap.josm.data.validation.tests.DuplicateRelation
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
public class DuplicateRelation extends Test
Tests if there are duplicate relations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DuplicateRelation.RelationMembers
Class to store relation membersprivate static class
DuplicateRelation.RelationPair
Class to store relation data (keys are usually cleanup and may not be equal to original relation)static class
DuplicateRelation.RelMember
Class to store one relation members and information about it-
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_RELATION
Code number of completely duplicated relation errorprivate Set<String>
ignoreKeys
List of keys without useful informationprivate MultiMap<DuplicateRelation.RelationPair,OsmPrimitive>
relations
MultiMap of all relationsprivate MultiMap<List<RelationMember>,OsmPrimitive>
relationsNoKeys
MultiMap of all relations, regardless of keysprotected static int
SAME_RELATION
Code number of relation with same members error-
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 DuplicateRelation()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endTest()
Notification of the end of the test.Command
fixError(TestError testError)
Fix the error by removing all but one instance of duplicate relationsboolean
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(Relation r)
Visiting call for relations.-
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, clear, deletePrimitivesIfNeeded, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isPrimitiveUsable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit, visit, visit
-
-
-
-
Field Detail
-
DUPLICATE_RELATION
protected static final int DUPLICATE_RELATION
Code number of completely duplicated relation error- See Also:
- Constant Field Values
-
SAME_RELATION
protected static final int SAME_RELATION
Code number of relation with same members error- See Also:
- Constant Field Values
-
relations
private MultiMap<DuplicateRelation.RelationPair,OsmPrimitive> relations
MultiMap of all relations
-
relationsNoKeys
private MultiMap<List<RelationMember>,OsmPrimitive> relationsNoKeys
MultiMap of all relations, regardless of keys
-
ignoreKeys
private final Set<String> ignoreKeys
List of keys without useful information
-
-
Constructor Detail
-
DuplicateRelation
public DuplicateRelation()
Default 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).
-
visit
public void visit(Relation r)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for relations.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Overrides:
visit
in classTest
- Parameters:
r
- The relation to inspect.
-
fixError
public Command fixError(TestError testError)
Fix the error by removing all but one instance of duplicate relations- Overrides:
fixError
in classTest
- Parameters:
testError
- The error to fix, must be of typeDUPLICATE_RELATION
- Returns:
- The command to fix the error
-
-