Class UnconnectedWays
java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.UnconnectedWays
- All Implemented Interfaces:
OsmPrimitiveVisitor
- Direct Known Subclasses:
UnconnectedWays.UnconnectedHighways,UnconnectedWays.UnconnectedNaturalOrLanduse,UnconnectedWays.UnconnectedPower,UnconnectedWays.UnconnectedRailways,UnconnectedWays.UnconnectedWaterways
Checks if a way has an endpoint very near to another way.
This class is abstract since highway/railway/waterway/… ways must be handled separately. An actual implementation must override
This class is abstract since highway/railway/waterway/… ways must be handled separately. An actual implementation must override
isPrimitiveUsable(OsmPrimitive)
to denote which kind of primitives can be handled.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classstatic classUnconnected highways test.static classUnconnected natural/landuse test.static classUnconnected power ways test.static classUnconnected railways test.static classUnconnected waterways test.Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate static final String(package private) static final doubleprivate DataSetprivate Areaprivate final booleanprivate doubleprivate doubleprivate doubleprivate static final Stringprivate static final Stringprivate static final Stringprotected static final Stringprivate QuadBuckets<Node>protected static final intprivate List<UnconnectedWays.MyWaySegment>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
ConstructorsModifierConstructorDescriptionprotectedUnconnectedWays(String title) Constructs a newUnconnectedWaystest.protectedUnconnectedWays(String title, int code, boolean isHighwayTest) Constructs a newUnconnectedWaystest with the given code. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidprivate voidaddIfNewOrCloser(Map<Node, UnconnectedWays.MyWaySegment> map, Node node, UnconnectedWays.MyWaySegment ws) private voidvoidendTest()Notification of the end of the test.private voidfillSearchNodes(Collection<Node> nodes) protected Map<Node,UnconnectedWays.MyWaySegment> protected WaygetWantedParentWay(Node endnode) An unconnected node might have multiple parent ways, e.g.protected Map<Node,UnconnectedWays.MyWaySegment> protected Map<Node,UnconnectedWays.MyWaySegment> (package private) List<UnconnectedWays.MyWaySegment>protected booleanCheck if unconnected end node should be ignored.protected abstract booleanbooleanDetermines if the primitive is usable for tests.protected booleanisWantedWay(Way w) voidstartTest(ProgressMonitor monitor) Start the test using a given progress monitorvoidVisiting call for points.voidVisiting call for lines.Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, clear, deletePrimitivesIfNeeded, fixError, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isFixable, isResidentialArea, ok, removeIrrelevantErrors, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit, visit
-
Field Details
-
POWER
- See Also:
-
PLATFORM
- See Also:
-
PLATFORM_EDGE
- See Also:
-
CONSTRUCTION
- See Also:
-
code
-
isHighwayTest
-
DETOUR_FACTOR
- See Also:
-
UNCONNECTED_WAYS
- See Also:
-
PREFIX
-
waySegments
-
endnodes
-
middlenodes
-
othernodes
-
searchNodes
-
waysToTest
-
nodesToTest
-
dsArea
-
mindist
-
minmiddledist
-
maxLen
-
ds
-
-
Constructor Details
-
UnconnectedWays
Constructs a newUnconnectedWaystest.- Parameters:
title- The test title- Since:
- 6691
-
UnconnectedWays
Constructs a newUnconnectedWaystest with the given code.- Parameters:
title- The test titlecode- The test codeisHighwayTest- usetrueif test concerns highways or railways- Since:
- 14468
-
-
Method Details
-
isCandidate
-
isWantedWay
-
ignoreUnconnectedEndNode
Check if unconnected end node should be ignored.- Parameters:
n- the node- Returns:
- true if node should be ignored
-
isPrimitiveUsable
Description copied from class:TestDetermines if the primitive is usable for tests.- Overrides:
isPrimitiveUsablein classTest- Parameters:
p- The primitive- Returns:
trueif the primitive can be tested,falseotherwise
-
startTest
Description copied from class:TestStart the test using a given progress monitor -
getHighwayEndNodesNearOtherHighway
-
getWayEndNodesNearOtherWay
-
getWayNodesNearOtherWay
-
getWantedParentWay
An unconnected node might have multiple parent ways, e.g. a highway and a landuse way. Make sure we get the one that was analysed before.- Parameters:
endnode- the node which is known to be an end node of the wanted way- Returns:
- the wanted way
-
addIfNewOrCloser
private void addIfNewOrCloser(Map<Node, UnconnectedWays.MyWaySegment> map, Node node, UnconnectedWays.MyWaySegment ws) -
addErrors
-
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). -
fillSearchNodes
-
getWaySegments
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
w- The way to inspect.
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for points.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
n- The node to inspect.
-
addNode
-