Class LongSegment
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.Test
-
- org.openstreetmap.josm.data.validation.tests.LongSegment
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
public class LongSegment extends Test
Checks for very long segments.- Since:
- 8320
-
-
Nested Class Summary
-
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
LONG_SEGMENT
Long segment errorprotected int
maxlength
Maximum segment length for this testprotected java.util.Set<WaySegment>
reported
set of way segments that have been reportedprivate java.util.Set<Way>
visitedWays
set of visited ways.-
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 LongSegment()
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addErrorForSegment(WaySegment waySegment, java.lang.Double length)
void
endTest()
Notification of the end of the test.private boolean
ignoreWay(Way w)
boolean
isPrimitiveUsable(OsmPrimitive p)
Determines if the primitive is usable for tests.private static boolean
isUsableNode(OsmPrimitive p)
private static boolean
isUsableWay(OsmPrimitive p)
void
startTest(ProgressMonitor monitor)
Start the test using a given progress monitorprivate void
testWay(Way w)
void
visit(Node n)
Visiting call for points.void
visit(Way w)
Visiting call for lines.private void
visitWaySegment(Way w, int i)
-
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 Detail
-
LONG_SEGMENT
protected static final int LONG_SEGMENT
Long segment error- See Also:
- Constant Field Values
-
maxlength
protected int maxlength
Maximum segment length for this test
-
visitedWays
private java.util.Set<Way> visitedWays
set of visited ways. Tracking this increases performance when checking single nodes.
-
reported
protected java.util.Set<WaySegment> reported
set of way segments that have been reported
-
-
Constructor Detail
-
LongSegment
public LongSegment()
Constructor
-
-
Method Detail
-
visit
public void visit(Node n)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for points.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Overrides:
visit
in classTest
- Parameters:
n
- The node to inspect.
-
visit
public void visit(Way w)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for lines.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Overrides:
visit
in classTest
- Parameters:
w
- The way to inspect.
-
visitWaySegment
private void visitWaySegment(Way w, int i)
-
addErrorForSegment
private void addErrorForSegment(WaySegment waySegment, java.lang.Double length)
-
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).
-
isPrimitiveUsable
public boolean isPrimitiveUsable(OsmPrimitive p)
Description copied from class:Test
Determines if the primitive is usable for tests.- Overrides:
isPrimitiveUsable
in classTest
- Parameters:
p
- The primitive- Returns:
true
if the primitive can be tested,false
otherwise
-
isUsableNode
private static boolean isUsableNode(OsmPrimitive p)
-
isUsableWay
private static boolean isUsableWay(OsmPrimitive p)
-
-