public class PowerLines extends Test
Modifier and Type | Class and Description |
---|---|
protected class |
PowerLines.PowerLineError |
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private java.util.List<PowerLines.PowerLineError> |
potentialErrors |
protected static java.util.Collection<java.lang.String> |
POWER_ALLOWED_TAGS
Values for
power key interpreted as allowed power items |
protected static java.util.Collection<java.lang.String> |
POWER_LINE_TAGS
Values for
power key interpreted as power lines |
protected static int |
POWER_LINES |
protected static java.util.Collection<java.lang.String> |
POWER_STATION_TAGS
Values for
power key interpreted as power stations |
protected static java.util.Collection<java.lang.String> |
POWER_TOWER_TAGS
Values for
power key interpreted as power towers |
private java.util.List<OsmPrimitive> |
powerStations |
private java.util.Map<Way,java.lang.String> |
towerPoleTagMap |
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
PowerLines()
Constructs a new
PowerLines test. |
Modifier and Type | Method and Description |
---|---|
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)
Helper function to check if power tags is a certain value.
|
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 |
startTest(ProgressMonitor progressMonitor)
Start the test using a given progress monitor
|
void |
visit(Relation r)
Visiting call for relations.
|
void |
visit(Way w)
Visiting call for lines.
|
addGui, deletePrimitivesIfNeeded, equals, getErrors, getName, hashCode, initialize, isBuilding, isCanceled, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit
visit
protected static final int POWER_LINES
protected static final java.util.Collection<java.lang.String> POWER_LINE_TAGS
power
key interpreted as power linesprotected static final java.util.Collection<java.lang.String> POWER_TOWER_TAGS
power
key interpreted as power towersprotected static final java.util.Collection<java.lang.String> POWER_STATION_TAGS
power
key interpreted as power stationsprotected static final java.util.Collection<java.lang.String> POWER_ALLOWED_TAGS
power
key interpreted as allowed power itemsprivate final java.util.Map<Way,java.lang.String> towerPoleTagMap
private final java.util.List<PowerLines.PowerLineError> potentialErrors
private final java.util.List<OsmPrimitive> powerStations
public PowerLines()
PowerLines
test.public void visit(Relation r)
Visitor
public void startTest(ProgressMonitor progressMonitor)
Test
public void endTest()
Test
If you override this method, don't forget to cleanup progressMonitor
(most overrides call super.endTest()
to do this).
protected final boolean isInPowerStation(Node n)
public Command fixError(TestError testError)
Test
public boolean isFixable(TestError testError)
Test
protected static final boolean isPowerLine(Way w)
w
- The way to be testedtrue
if power key is set and equal to line/minor_lineprotected static final boolean isPowerStation(OsmPrimitive p)
p
- The primitive to be testedtrue
if power key is set and equal to station/sub_station/plantprotected static final boolean isPowerTower(Node n)
n
- The node to be testedtrue
if power key is set and equal to tower/poleprotected static final boolean isPowerAllowed(Node n)
n
- The node to be testedprivate static boolean isPowerIn(OsmPrimitive p, java.util.Collection<java.lang.String> values)
p
- The primitive to be testedvalues
- List of possible valuestrue
if power key is set and equal to possible values