Class DuplicateWay

java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.DuplicateWay
All Implemented Interfaces:
OsmPrimitiveVisitor

public class DuplicateWay extends Test
Tests if there are duplicate ways
  • Field Details

  • Constructor Details

  • Method Details

    • startTest

      public void startTest(ProgressMonitor monitor)
      Description copied from class: Test
      Start the test using a given progress monitor
      Overrides:
      startTest in class Test
      Parameters:
      monitor - 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
    • removeUninterestingKeys

      public void removeUninterestingKeys(Map<String,String> wkeys)
      Remove uninteresting discardable keys to normalize the tags
      Parameters:
      wkeys - The tags of the way, obtained by Way#getKeys
    • visit

      public void visit(Way w)
      Description copied from interface: OsmPrimitiveVisitor
      Visiting call for lines.
      Specified by:
      visit in interface OsmPrimitiveVisitor
      Overrides:
      visit in class Test
      Parameters:
      w - The way to inspect.
    • checkWay

      private void checkWay(Way w)
    • getOrderedNodes

      public static List<LatLon> getOrderedNodes(Way w)
      Replies the ordered list of nodes of way w such as it is easier to find duplicated ways. In case of a closed way, build the list of lat/lon starting from the node with the lowest id to ensure this list will produce the same hashcode as the list obtained from another closed way with the same nodes, in the same order, but that does not start from the same node (fix #8008)
      Parameters:
      w - way
      Returns:
      the ordered list of nodes of way w such as it is easier to find duplicated ways
      Since:
      7721
    • fixError

      public Command fixError(TestError testError)
      Fix the error by removing all but one instance of duplicate ways
      Overrides:
      fixError in class Test
      Parameters:
      testError - error to fix
      Returns:
      The command to fix the error
    • isFixable

      public boolean isFixable(TestError testError)
      Description copied from class: Test
      Returns true if the given error can be fixed automatically
      Overrides:
      isFixable in class Test
      Parameters:
      testError - The error to check if can be fixed
      Returns:
      true if the error can be fixed