public class PowerLines extends Test
Test.TagTest
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Collection<java.lang.String> |
BUILDING_STATION_TAGS
Values for
building key interpreted as power stations |
private java.util.List<TestError> |
potentialErrors |
(package private) static java.util.Collection<java.lang.String> |
POWER_ALLOWED_TAGS
Values for
power key interpreted as allowed power items |
(package private) static java.util.Collection<java.lang.String> |
POWER_LINE_TAGS
Values for
power key interpreted as power lines |
protected static int |
POWER_LINES
Test identifier
|
(package private) static java.util.Collection<java.lang.String> |
POWER_STATION_TAGS
Values for
power key interpreted as power stations |
(package private) static java.util.Collection<java.lang.String> |
POWER_TOWER_TAGS
Values for
power key interpreted as power towers |
private java.util.List<OsmPrimitive> |
powerStations |
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, 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.
|
private static boolean |
isBuildingIn(OsmPrimitive p,
java.util.Collection<java.lang.String> values)
Helper function to check if building tag is a certain value.
|
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 tag 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, compareTo, deletePrimitivesIfNeeded, equals, fixError, getErrors, getName, hashCode, initialize, isBuilding, isCanceled, isFixable, isPrimitiveUsable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit
protected static final int POWER_LINES
static final java.util.Collection<java.lang.String> POWER_LINE_TAGS
power
key interpreted as power linesstatic final java.util.Collection<java.lang.String> POWER_TOWER_TAGS
power
key interpreted as power towersstatic final java.util.Collection<java.lang.String> POWER_STATION_TAGS
power
key interpreted as power stationsstatic final java.util.Collection<java.lang.String> BUILDING_STATION_TAGS
building
key interpreted as power stationsstatic final java.util.Collection<java.lang.String> POWER_ALLOWED_TAGS
power
key interpreted as allowed power itemsprivate final java.util.List<TestError> potentialErrors
private final java.util.List<OsmPrimitive> powerStations
public PowerLines()
PowerLines
test.public void visit(Way w)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
w
- The way to inspect.public void visit(Relation r)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
r
- The relation to inspect.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)
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 valuesprivate static boolean isBuildingIn(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