public class PowerLines extends Test
Modifier and Type | Class and Description |
---|---|
protected class |
PowerLines.PowerLineError |
Modifier and Type | Field and Description |
---|---|
private List<PowerLines.PowerLineError> |
potentialErrors |
static Collection<String> |
POWER_ALLOWED_TAGS
Values for
power key interpreted as allowed power items |
static Collection<String> |
POWER_LINE_TAGS
Values for
power key interpreted as power lines |
protected static int |
POWER_LINES |
static Collection<String> |
POWER_STATION_TAGS
Values for
power key interpreted as power stations |
static Collection<String> |
POWER_TOWER_TAGS
Values for
power key interpreted as power towers |
private List<OsmPrimitive> |
powerStations |
private Map<Way,String> |
towerPoleTagMap |
checkBeforeUpload, checkEnabled, description, enabled, errors, 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,
Collection<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, getErrors, getName, initialize, isBuilding, isCanceled, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit
visit
protected static final int POWER_LINES
public static final Collection<String> POWER_LINE_TAGS
power
key interpreted as power linespublic static final Collection<String> POWER_TOWER_TAGS
power
key interpreted as power towerspublic static final Collection<String> POWER_STATION_TAGS
power
key interpreted as power stationspublic static final Collection<String> POWER_ALLOWED_TAGS
power
key interpreted as allowed power itemsprivate final Map<Way,String> towerPoleTagMap
private final List<PowerLines.PowerLineError> potentialErrors
private final 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 Test.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 final boolean isPowerIn(OsmPrimitive p, Collection<String> values)
p
- The primitive to be testedvalues
- List of possible valuestrue
if power key is set and equal to possible values