|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.osm.visitor.AbstractVisitor
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.PowerLines
public class PowerLines
Checks for nodes in power lines/minor_lines that do not have a power=tower/pole tag.
See #7812 for discussions about this test.
Nested Class Summary | |
---|---|
protected class |
PowerLines.PowerLineError
|
Field Summary | |
---|---|
protected java.util.List<PowerLines.PowerLineError> |
potentialErrors
|
static java.util.Collection<java.lang.String> |
POWER_ALLOWED_TAGS
|
static java.util.Collection<java.lang.String> |
POWER_LINE_TAGS
|
protected static int |
POWER_LINES
|
static java.util.Collection<java.lang.String> |
POWER_STATION_TAGS
|
static java.util.Collection<java.lang.String> |
POWER_TOWER_TAGS
|
protected java.util.List<OsmPrimitive> |
powerStations
|
protected java.util.Map<Way,java.lang.String> |
towerPoleTagMap
|
Fields inherited from class org.openstreetmap.josm.data.validation.Test |
---|
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload |
Constructor Summary | |
---|---|
PowerLines()
|
Method Summary | |
---|---|
void |
endTest()
Notification of the end of the test. |
Command |
fixError(TestError testError)
Fixes the error with the appropriate command |
boolean |
isFixable(TestError testError)
Returns true if the given error can be fixed automatically |
protected boolean |
isInPowerStation(Node n)
|
protected static boolean |
isPowerAllowed(Node n)
Determines if the specified node denotes a power infrastructure allowed on a power line. |
private static boolean |
isPowerIn(OsmPrimitive p,
java.util.Collection<java.lang.String> values)
|
protected static boolean |
isPowerLine(Way w)
Determines if the specified way denotes a power line. |
protected static boolean |
isPowerStation(OsmPrimitive p)
Determines if the specified primitive denotes a power station. |
protected static boolean |
isPowerTower(Node n)
Determines if the specified node denotes a power tower/pole. |
void |
visit(Relation r)
Visiting call for relations. |
void |
visit(Way w)
Visiting call for lines. |
Methods inherited from class org.openstreetmap.josm.data.validation.Test |
---|
addGui, deletePrimitivesIfNeeded, getErrors, getName, initialize, isBuilding, isCanceled, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, 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 |
---|
protected static final int POWER_LINES
public static final java.util.Collection<java.lang.String> POWER_LINE_TAGS
public static final java.util.Collection<java.lang.String> POWER_TOWER_TAGS
public static final java.util.Collection<java.lang.String> POWER_STATION_TAGS
public static final java.util.Collection<java.lang.String> POWER_ALLOWED_TAGS
protected final java.util.Map<Way,java.lang.String> towerPoleTagMap
protected final java.util.List<PowerLines.PowerLineError> potentialErrors
protected final java.util.List<OsmPrimitive> powerStations
Constructor Detail |
---|
public PowerLines()
Method Detail |
---|
public void visit(Way w)
Visitor
visit
in interface Visitor
visit
in class Test
w
- The way to inspect.public void visit(Relation r)
Visitor
visit
in interface Visitor
visit
in class Test
r
- The relation to inspect.public void endTest()
Test
If you override this method, don't forget to cleanup Test.progressMonitor
(most overrides call super.endTest()
to do this).
endTest
in class Test
protected final boolean isInPowerStation(Node n)
public Command fixError(TestError testError)
Test
fixError
in class Test
public boolean isFixable(TestError testError)
Test
isFixable
in class Test
testError
- The error to check if can be fixed
protected static final boolean isPowerLine(Way w)
w
- The way to be tested
protected static final boolean isPowerStation(OsmPrimitive p)
w
- The way to be tested
protected static final boolean isPowerTower(Node n)
w
- The node to be tested
protected static final boolean isPowerAllowed(Node n)
w
- The node to be tested
private static final boolean isPowerIn(OsmPrimitive p, java.util.Collection<java.lang.String> values)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |