Ticket #6102: UnconnectedWays.diff

File UnconnectedWays.diff, 3.6 KB (added by Nakor, 15 years ago)

patch

  • src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

     
    5959     */
    6060    public UnconnectedWays() {
    6161        super(tr("Unconnected ways."),
    62               tr("This test checks if a way has an endpoint very near to another way."));
     62                tr("This test checks if a way has an endpoint very near to another way."));
    6363    }
    6464
    6565    @Override
     
    7070        endnodes_highway = new HashSet<Node>();
    7171        middlenodes = new HashSet<Node>();
    7272        othernodes = new HashSet<Node>();
    73         mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0)/6378135.0;
    74         minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0)/6378135.0;
     73        mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0);
     74        minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0);
    7575        this.ds = Main.main.getCurrentDataSet();
    7676        this.ds_area = ds.getDataSourceArea();
    7777    }
     
    9898                        continue;
    9999                    }
    100100                    if ("turning_circle".equals(en.get("highway"))
    101                         || "bus_stop".equals(en.get("highway"))
    102                         || "buffer_stop".equals(en.get("railway"))
    103                         || OsmUtils.isTrue(en.get("noexit"))
    104                         || en.hasKey("barrier")) {
     101                            || "bus_stop".equals(en.get("highway"))
     102                            || "buffer_stop".equals(en.get("railway"))
     103                            || OsmUtils.isTrue(en.get("noexit"))
     104                            || en.hasKey("barrier")) {
    105105                        continue;
    106106                    }
    107107                    // There's a small false-positive here.  Imagine an intersection
     
    203203            this.highway = (highway != null || railway != null) && !isAbandoned;
    204204            this.isBoundary = !this.highway && "administrative".equals(w.get("boundary"));
    205205            line = new Line2D.Double(n1.getEastNorth().east(), n1.getEastNorth().north(),
    206                                      n2.getEastNorth().east(), n2.getEastNorth().north());
     206                    n2.getEastNorth().east(), n2.getEastNorth().north());
    207207            len = line.getP1().distance(line.getP2());
    208208            this.n1 = n1;
    209209            this.n2 = n2;
     
    295295
    296296            for (Node n : found_nodes) {
    297297                if (!nearby(n, dist) ||
    298                      (ds_area != null && !ds_area.contains(n.getCoor()))) {
     298                        (ds_area != null && !ds_area.contains(n.getCoor()))) {
    299299                    continue;
    300300                }
    301301                // It is actually very rare for us to find a node
     
    315315
    316316        public boolean isArea() {
    317317            return w.hasKey("landuse")
    318                 || w.hasKey("leisure")
    319                 || w.hasKey("amenity")
    320                 || w.hasKey("building");
     318            || w.hasKey("leisure")
     319            || w.hasKey("amenity")
     320            || w.hasKey("building");
    321321        }
    322322    }
    323323
    324324    List<MyWaySegment> getWaySegments(Way w) {
    325325        List<MyWaySegment> ret = new ArrayList<MyWaySegment>();
    326326        if (!w.isUsable()
    327             || w.hasKey("barrier")
    328             || "cliff".equals(w.get("natural")))
     327                || w.hasKey("barrier")
     328                || "cliff".equals(w.get("natural")))
    329329            return ret;
    330330
    331331        int size = w.getNodesCount();