Class PowerLines

  • All Implemented Interfaces:
    OsmPrimitiveVisitor

    public class PowerLines
    extends Test
    Checks for nodes in power lines/minor_lines that do not have a power=tower/pole tag.
    See #7812 for discussions about this test.
    • Constructor Detail

      • PowerLines

        public PowerLines()
        Constructs a new PowerLines test.
    • Method Detail

      • startTest

        public void startTest​(ProgressMonitor progressMonitor)
        Description copied from class: Test
        Start the test using a given progress monitor
        Overrides:
        startTest in class Test
        Parameters:
        progressMonitor - the progress monitor
      • endTest

        public void endTest()
        Description copied from class: Test
        Notification of the end of the test. The tester may perform additional actions and destroy the used structures.

        If you override this method, don't forget to cleanup progressMonitor (most overrides call super.endTest() to do this).

        Overrides:
        endTest in class Test
      • isPowerLine

        protected static final boolean isPowerLine​(Way w)
        Determines if the specified way denotes a power line.
        Parameters:
        w - The way to be tested
        Returns:
        true if power key is set and equal to line/minor_line
      • isPowerStation

        protected static final boolean isPowerStation​(OsmPrimitive p)
        Determines if the specified primitive denotes a power station.
        Parameters:
        p - The primitive to be tested
        Returns:
        true if power key is set and equal to station/sub_station/plant
      • isPowerTower

        protected static final boolean isPowerTower​(Node n)
        Determines if the specified node denotes a power tower/pole.
        Parameters:
        n - The node to be tested
        Returns:
        true if power key is set and equal to tower/pole
      • isPowerAllowed

        protected static final boolean isPowerAllowed​(Node n)
        Determines if the specified node denotes a power infrastructure allowed on a power line.
        Parameters:
        n - The node to be tested
        Returns:
        True if power key is set and equal to switch/tranformer/busbar/generator
      • isPowerIn

        private static boolean isPowerIn​(OsmPrimitive p,
                                         Collection<String> values)
        Helper function to check if power tag is a certain value.
        Parameters:
        p - The primitive to be tested
        values - List of possible values
        Returns:
        true if power key is set and equal to possible values
      • isBuildingIn

        private static boolean isBuildingIn​(OsmPrimitive p,
                                            Collection<String> values)
        Helper function to check if building tag is a certain value.
        Parameters:
        p - The primitive to be tested
        values - List of possible values
        Returns:
        true if power key is set and equal to possible values