Class CrossingWays
java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.CrossingWays
- All Implemented Interfaces:
OsmPrimitiveVisitor
- Direct Known Subclasses:
CrossingWays.Boundaries,CrossingWays.SelfCrossing,CrossingWays.Ways
Tests if there are segments that crosses in the same layer/level
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCrossing boundaries ways test.(package private) static final classstatic classSelf crossing ways test (for all ways)static classGeneral crossing ways test.private static enumType of way.Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Stringprivate final Map<Point2D,List<WaySegment>> All way segments, grouped by cellsprotected final int(package private) static final String(package private) static final String(package private) static final Stringprivate final Map<List<Way>,List<WaySegment>> The already detected ways in error(package private) static final StringFields 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
ConstructorsModifierConstructorDescriptionprotectedCrossingWays(String title, int code) Constructs a newCrossingWaystest. -
Method Summary
Modifier and TypeMethodDescriptionprivate Collection<Way>private static booleanareLayerOrLevelDifferent(Way w1, Way w2) (package private) CrossingWays.MessageHelpercreateMessage(Way w1, Way w2) voidendTest()Notification of the end of the test.static voidfindIntersectingWay(Way w, Map<Point2D, List<WaySegment>> cellSegments, Map<List<Way>, List<WaySegment>> crossingWays, boolean findSharedWaySegments) Find ways which are crossing without sharing a node.static List<List<WaySegment>>getSegments(Map<Point2D, List<WaySegment>> cellSegments, EastNorth n1, EastNorth n2) Returns all the cells this segment crosses.static List<List<WaySegment>>getSegments(Map<Point2D, List<WaySegment>> cellSegments, ILatLon n1, ILatLon n2) Returns all the cells this segment crosses.(package private) abstract booleanignoreWaySegmentCombination(Way w1, Way w2) (package private) static boolean(package private) static boolean(package private) static boolean(package private) static booleanstatic booleanisSelfCrossing(Way way) Check if the given way is self crossing(package private) static boolean(package private) static boolean(package private) static booleanprotected voidrunTest()voidstartTest(ProgressMonitor monitor) Start the test using a given progress monitorprivate voidvoidVisiting call for lines.Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, clear, deletePrimitivesIfNeeded, fixError, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isFixable, isPrimitiveUsable, isResidentialArea, ok, removeIrrelevantErrors, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit, visit, visit
-
Field Details
-
BARRIER
- See Also:
-
HIGHWAY
- See Also:
-
RAILWAY
- See Also:
-
WATERWAY
- See Also:
-
LANDUSE
- See Also:
-
cellSegments
All way segments, grouped by cells -
seenWays
The already detected ways in error -
waysToTest
-
code
-
-
Constructor Details
-
CrossingWays
Constructs a newCrossingWaystest.- Parameters:
title- The test titlecode- The test code- Since:
- 12958
-
-
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). -
runTest
-
addNearbyObjects
-
isCoastline
-
isWaterArea
-
isWaterAreaOrFairway
-
isHighway
-
isRailway
-
isSubwayOrTramOrRazed
-
isProposedOrAbandoned
-
ignoreWaySegmentCombination
-
createMessage
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
w- The way to inspect.
-
testWay
-
areLayerOrLevelDifferent
-
getSegments
public static List<List<WaySegment>> getSegments(Map<Point2D, List<WaySegment>> cellSegments, EastNorth n1, EastNorth n2) Returns all the cells this segment crosses. Each cell contains the list of segments already processed- Parameters:
cellSegments- map with already collected way segmentsn1- The first EastNorthn2- The second EastNorth- Returns:
- A list with all the cells the segment crosses
-
getSegments
public static List<List<WaySegment>> getSegments(Map<Point2D, List<WaySegment>> cellSegments, ILatLon n1, ILatLon n2) Returns all the cells this segment crosses. Each cell contains the list of segments already processed- Parameters:
cellSegments- map with already collected way segmentsn1- The first EastNorthn2- The second EastNorth- Returns:
- A list with all the cells the segment crosses
- Since:
- 18553
-
findIntersectingWay
public static void findIntersectingWay(Way w, Map<Point2D, List<WaySegment>> cellSegments, Map<List<Way>, List<WaySegment>> crossingWays, boolean findSharedWaySegments) Find ways which are crossing without sharing a node.- Parameters:
w- way that is to be checkedcellSegments- map with already collected way segmentscrossingWays- map to collect crossing ways and related segmentsfindSharedWaySegments- true: find shared way segments instead of crossings
-
isSelfCrossing
Check if the given way is self crossing- Parameters:
way- the way to check- Returns:
trueif one or more segments of the way are crossing- Since:
- 17393
- See Also:
-