Class DuplicateWay
java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.DuplicateWay
- All Implemented Interfaces:
OsmPrimitiveVisitor
Tests if there are duplicate ways
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classClass to store a way reduced to coordinates and keys.private static classClass to store a way reduced to coordinates.Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intTest identification for exactly identical ways (coordinates and tags).Set of known hashcodes for list of coordinatesprotected static final intTest identification for identical ways (coordinates only).private MultiMap<DuplicateWay.WayPair,OsmPrimitive> Bag of all waysBag of all ways, regardless of tagsFields 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 voidvoidendTest()Notification of the end of the test.Fix the error by removing all but one instance of duplicate waysReplies the ordered list of nodes of way w such as it is easier to find duplicated ways.booleanReturns true if the given error can be fixed automaticallyvoidremoveUninterestingKeys(Map<String, String> wkeys) Remove uninteresting discardable keys to normalize the tagsvoidstartTest(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
-
DUPLICATE_WAY
Test identification for exactly identical ways (coordinates and tags).- See Also:
-
SAME_WAY
Test identification for identical ways (coordinates only).- See Also:
-
ways
Bag of all ways -
waysNoTags
Bag of all ways, regardless of tags -
knownHashCodes
Set of known hashcodes for list of coordinates -
waysToCheck
-
-
Constructor Details
-
DuplicateWay
public DuplicateWay()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). -
removeUninterestingKeys
Remove uninteresting discardable keys to normalize the tags- Parameters:
wkeys- The tags of the way, obtained byWay#getKeys
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
w- The way to inspect.
-
checkWay
-
getOrderedNodes
Replies the ordered list of nodes of way w such as it is easier to find duplicated ways. In case of a closed way, build the list of lat/lon starting from the node with the lowest id to ensure this list will produce the same hashcode as the list obtained from another closed way with the same nodes, in the same order, but that does not start from the same node (fix #8008)- Parameters:
w- way- Returns:
- the ordered list of nodes of way w such as it is easier to find duplicated ways
- Since:
- 7721
-
fixError
Fix the error by removing all but one instance of duplicate ways -
isFixable
Description copied from class:TestReturns true if the given error can be fixed automatically
-