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 intLONG_SEGMENTLong segment errorprotected intmaxlengthMaximum segment length for this testprotected java.util.Set<WaySegment>reportedset of way segments that have been reportedprivate java.util.Set<Way>visitedWaysset 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 voidaddErrorForSegment(WaySegment waySegment, java.lang.Double length)voidendTest()Notification of the end of the test.private booleanignoreWay(Way w)booleanisPrimitiveUsable(OsmPrimitive p)Determines if the primitive is usable for tests.private static booleanisUsableNode(OsmPrimitive p)private static booleanisUsableWay(OsmPrimitive p)voidstartTest(ProgressMonitor monitor)Start the test using a given progress monitorprivate voidtestWay(Way w)voidvisit(Node n)Visiting call for points.voidvisit(Way w)Visiting call for lines.private voidvisitWaySegment(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:OsmPrimitiveVisitorVisiting call for points.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
n- The node to inspect.
-
visit
public void visit(Way w)
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin 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:TestStart the test using a given progress monitor
-
endTest
public void 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).
-
isPrimitiveUsable
public boolean isPrimitiveUsable(OsmPrimitive p)
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
-
isUsableNode
private static boolean isUsableNode(OsmPrimitive p)
-
isUsableWay
private static boolean isUsableWay(OsmPrimitive p)
-
-