org.openstreetmap.josm.data.validation.tests
Class CrossingWays

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.Test
          extended by org.openstreetmap.josm.data.validation.tests.CrossingWays
All Implemented Interfaces:
Visitor

public class CrossingWays
extends Test

Tests if there are segments that crosses in the same layer


Nested Class Summary
static class CrossingWays.ExtendedSegment
          A way segment with some additional information
 
Field Summary
(package private)  java.util.Map<java.awt.geom.Point2D,java.util.List<CrossingWays.ExtendedSegment>> cellSegments
          All way segments, grouped by cells
protected static int CROSSING_WAYS
           
(package private)  java.util.HashSet<WaySegment> errorSegments
          The already detected errors
(package private)  java.util.Map<java.util.List<Way>,java.util.List<WaySegment>> ways_seen
          The already detected ways in error
 
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload
 
Constructor Summary
CrossingWays()
          Constructor
 
Method Summary
 void endTest()
          Notification of the end of the test.
 java.util.List<java.util.List<CrossingWays.ExtendedSegment>> getSegments(Node n1, Node n2)
          Returns all the cells this segment crosses.
 void startTest(ProgressMonitor monitor)
          Start the test using a given progress monitor
 void visit(Way w)
          Visiting call for lines.
 
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, deletePrimitivesIfNeeded, fixError, getErrors, getName, initialize, isBuilding, isCanceled, isFixable, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit, visit
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CROSSING_WAYS

protected static final int CROSSING_WAYS
See Also:
Constant Field Values

cellSegments

java.util.Map<java.awt.geom.Point2D,java.util.List<CrossingWays.ExtendedSegment>> cellSegments
All way segments, grouped by cells


errorSegments

java.util.HashSet<WaySegment> errorSegments
The already detected errors


ways_seen

java.util.Map<java.util.List<Way>,java.util.List<WaySegment>> ways_seen
The already detected ways in error

Constructor Detail

CrossingWays

public CrossingWays()
Constructor

Method Detail

startTest

public void startTest(ProgressMonitor monitor)
Description copied from class: Test
Start the test using a given progress monitor

Overrides:
startTest in class Test
Parameters:
monitor - the 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 Test.progressMonitor (most overrides call super.endTest() to do this).

Overrides:
endTest in class Test

visit

public void visit(Way w)
Description copied from interface: Visitor
Visiting call for lines.

Specified by:
visit in interface Visitor
Overrides:
visit in class Test
Parameters:
w - The way to inspect.

getSegments

public java.util.List<java.util.List<CrossingWays.ExtendedSegment>> getSegments(Node n1,
                                                                                Node n2)
Returns all the cells this segment crosses. Each cell contains the list of segments already processed

Parameters:
n1 - The first node
n2 - The second node
Returns:
A list with all the cells the segment crosses


JOSM