Ticket #13570: 13570_area.patch

File 13570_area.patch, 1.4 KB (added by GerdP, 8 years ago)
  • src/org/openstreetmap/josm/data/validation/tests/Coastlines.java

     
    3939    protected static final int WRONG_ORDER_COASTLINE = 904;
    4040
    4141    private List<Way> coastlineWays;
     42    private Area downloadedArea;
    4243
    4344    /**
    4445     * Constructor
     
    5152    public void startTest(ProgressMonitor monitor) {
    5253        super.startTest(monitor);
    5354        coastlineWays = new LinkedList<>();
     55        downloadedArea = null;
    5456    }
    5557
    5658    @Override
     
    7173     * Nodes outside the download area are special cases, we may not know enough about the connected ways.
    7274     */
    7375    private void checkConnections() {
    74         Area downloadedArea = null;
    7576        for (Way w : coastlineWays) {
    76             if (downloadedArea == null) {
    77                 downloadedArea = w.getDataSet().getDataSourceArea();
    78             }
    7977            int numNodes = w.getNodesCount();
    8078            for (int i = 0; i < numNodes; i++) {
    8179                Node n = w.getNode(i);
     
    237235
    238236        if (isCoastline(way)) {
    239237            coastlineWays.add(way);
     238            if (downloadedArea == null) {
     239                downloadedArea = way.getDataSet().getDataSourceArea();
     240            }
    240241        }
    241242    }
    242243