Changeset 4481 in josm for trunk/src


Ignore:
Timestamp:
2011-10-01T14:23:58+02:00 (13 years ago)
Author:
simon04
Message:

fix #6911 - "Crossing ways" warning for ways waterway=riverbank and waterway=river

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

    r4048 r4481  
    7474        boolean isTram1 = "tram".equals(railway1);
    7575        boolean isBuilding = (w.get("building") != null);
     76        String waterway1 = w.get("waterway");
    7677
    7778        if (w.get("highway") == null && w.get("waterway") == null
     
    8687        for (int i = 0; i < nodesSize - 1; i++) {
    8788            WaySegment ws = new WaySegment(w, i);
    88             ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, isCoastline1);
     89            ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, isCoastline1, waterway1);
    8990            List<List<ExtendedSegment>> cellSegments = getSegments(es1.n1, es1.n2);
    9091            for (List<ExtendedSegment> segments : cellSegments) {
     
    107108
    108109                    if (isCoastline1 != isCoastline2) continue;
     110                    if (("river".equals(waterway1) && "riverbank".equals(es2.waterway))
     111                            || ("riverbank".equals(waterway1) && "river".equals(es2.waterway))) continue;
    109112
    110113                    if ((es1.railway != null && es1.railway.equals("abandoned"))
     
    170173        public String railway;
    171174
     175        /** The waterway type */
     176        public String waterway;
     177
    172178        /** The coastline type */
    173179        public boolean coastline;
     
    179185         * @param railway The railway type of the way this segment is in
    180186         * @param coastline The coastline flag of the way the segment is in
     187         * @param waterway The waterway type of the way this segment is in
    181188         */
    182         public ExtendedSegment(WaySegment ws, String layer, String railway, boolean coastline) {
     189        public ExtendedSegment(WaySegment ws, String layer, String railway, boolean coastline, String waterway) {
    183190            this.ws = ws;
    184191            this.n1 = ws.way.getNodes().get(ws.lowerIndex);
     
    187194            this.railway = railway;
    188195            this.coastline = coastline;
     196            this.waterway = waterway;
    189197        }
    190198
Note: See TracChangeset for help on using the changeset viewer.