public abstract class UnconnectedWays extends Test
isPrimitiveUsable(OsmPrimitive)
to denote which kind of primitives can be handled.Modifier and Type | Class and Description |
---|---|
private class |
UnconnectedWays.MyWaySegment |
static class |
UnconnectedWays.UnconnectedHighways
Unconnected highways test.
|
static class |
UnconnectedWays.UnconnectedNaturalOrLanduse
Unconnected natural/landuse test.
|
static class |
UnconnectedWays.UnconnectedPower
Unconnected power ways test.
|
static class |
UnconnectedWays.UnconnectedRailways
Unconnected railways test.
|
static class |
UnconnectedWays.UnconnectedWaterways
Unconnected waterways test.
|
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private int |
code |
private DataSet |
ds |
private java.awt.geom.Area |
dsArea |
private java.util.Set<Node> |
endnodes |
private boolean |
isHighwayTest |
private double |
maxLen |
private java.util.Set<Node> |
middlenodes |
private double |
mindist |
private double |
minmiddledist |
private java.util.Set<Node> |
nodesToTest |
private java.util.Set<Node> |
othernodes |
protected static java.lang.String |
PREFIX |
private QuadBuckets<Node> |
searchNodes |
protected static int |
UNCONNECTED_WAYS |
private java.util.List<UnconnectedWays.MyWaySegment> |
waySegments |
private java.util.Set<Way> |
waysToTest |
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
UnconnectedWays(java.lang.String title)
Constructs a new
UnconnectedWays test. |
UnconnectedWays(java.lang.String title,
int code,
boolean isHighwayTest)
Constructs a new
UnconnectedWays test with the given code. |
Modifier and Type | Method and Description |
---|---|
protected void |
addErrors(Severity severity,
java.util.Map<Node,UnconnectedWays.MyWaySegment> errorMap,
java.lang.String message) |
private void |
addIfNewOrCloser(java.util.Map<Node,UnconnectedWays.MyWaySegment> map,
Node node,
UnconnectedWays.MyWaySegment ws) |
private void |
addNode(Node n,
java.util.Set<Node> s) |
void |
endTest()
Notification of the end of the test.
|
private void |
fillSearchNodes(java.util.Collection<Node> nodes) |
protected java.util.Map<Node,UnconnectedWays.MyWaySegment> |
getHighwayEndNodesNearOtherHighway() |
private Way |
getWantedParentWay(Node endnode)
An unconnected node might have multiple parent ways, e.g.
|
protected java.util.Map<Node,UnconnectedWays.MyWaySegment> |
getWayEndNodesNearOtherWay() |
protected java.util.Map<Node,UnconnectedWays.MyWaySegment> |
getWayNodesNearOtherWay() |
(package private) java.util.List<UnconnectedWays.MyWaySegment> |
getWaySegments(Way w) |
protected boolean |
ignoreUnconnectedEndNode(Node n)
Check if unconnected end node should be ignored.
|
protected abstract boolean |
isCandidate(OsmPrimitive p) |
boolean |
isPrimitiveUsable(OsmPrimitive p)
Determines if the primitive is usable for tests.
|
protected boolean |
isWantedWay(Way w) |
void |
startTest(ProgressMonitor monitor)
Start the test using a given progress monitor
|
void |
visit(Node n)
Visiting call for points.
|
void |
visit(Way w)
Visiting call for lines.
|
addGui, clear, compareTo, deletePrimitivesIfNeeded, equals, fixError, getErrors, getName, hashCode, initialize, isBuilding, isCanceled, isFixable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit, visit
private final int code
private final boolean isHighwayTest
protected static final int UNCONNECTED_WAYS
protected static final java.lang.String PREFIX
private java.util.List<UnconnectedWays.MyWaySegment> waySegments
private java.util.Set<Node> middlenodes
private java.util.Set<Node> othernodes
private QuadBuckets<Node> searchNodes
private java.util.Set<Way> waysToTest
private java.util.Set<Node> nodesToTest
private java.awt.geom.Area dsArea
private double mindist
private double minmiddledist
private double maxLen
public UnconnectedWays(java.lang.String title)
UnconnectedWays
test.title
- The test titlepublic UnconnectedWays(java.lang.String title, int code, boolean isHighwayTest)
UnconnectedWays
test with the given code.title
- The test titlecode
- The test codeisHighwayTest
- use true
if test concerns highways or railwaysprotected abstract boolean isCandidate(OsmPrimitive p)
protected boolean isWantedWay(Way w)
protected boolean ignoreUnconnectedEndNode(Node n)
n
- the nodepublic boolean isPrimitiveUsable(OsmPrimitive p)
Test
isPrimitiveUsable
in class Test
p
- The primitivetrue
if the primitive can be tested, false
otherwisepublic void startTest(ProgressMonitor monitor)
Test
protected java.util.Map<Node,UnconnectedWays.MyWaySegment> getHighwayEndNodesNearOtherHighway()
protected java.util.Map<Node,UnconnectedWays.MyWaySegment> getWayEndNodesNearOtherWay()
protected java.util.Map<Node,UnconnectedWays.MyWaySegment> getWayNodesNearOtherWay()
private Way getWantedParentWay(Node endnode)
endnode
- the node which is known to be an end node of the wanted wayprivate void addIfNewOrCloser(java.util.Map<Node,UnconnectedWays.MyWaySegment> map, Node node, UnconnectedWays.MyWaySegment ws)
protected final void addErrors(Severity severity, java.util.Map<Node,UnconnectedWays.MyWaySegment> errorMap, java.lang.String message)
public void endTest()
Test
If you override this method, don't forget to cleanup progressMonitor
(most overrides call super.endTest()
to do this).
private void fillSearchNodes(java.util.Collection<Node> nodes)
java.util.List<UnconnectedWays.MyWaySegment> getWaySegments(Way w)
public void visit(Way w)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
w
- The way to inspect.public void visit(Node n)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
n
- The node to inspect.