Changeset 4048 in josm


Ignore:
Timestamp:
2011-04-20T15:43:21+02:00 (14 years ago)
Author:
stoecker
Message:

fix #6022 - better crossing way tests - patch by bilbo

File:
1 edited

Legend:

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

    r3671 r4048  
    6767            return;
    6868
    69         String coastline1 = w.get("natural");
    70         boolean isCoastline1 = "water".equals(coastline1) || "coastline".equals(coastline1);
     69        String natural1 = w.get("natural");
     70        String landuse1 = w.get("landuse");
     71        boolean isCoastline1 = "water".equals(natural1) || "coastline".equals(natural1) || "reservoir".equals(landuse1);
    7172        String railway1 = w.get("railway");
    7273        boolean isSubway1 = "subway".equals(railway1);
     
    8081
    8182        String layer1 = w.get("layer");
     83        if ("0".equals(layer1)) layer1 = null; //0 is default value
    8284
    8385        int nodesSize = w.getNodesCount();
    8486        for (int i = 0; i < nodesSize - 1; i++) {
    8587            WaySegment ws = new WaySegment(w, i);
    86             ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, coastline1);
     88            ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, isCoastline1);
    8789            List<List<ExtendedSegment>> cellSegments = getSegments(es1.n1, es1.n2);
    8890            for (List<ExtendedSegment> segments : cellSegments) {
     
    9698                    String layer2 = es2.layer;
    9799                    String railway2 = es2.railway;
    98                     String coastline2 = es2.coastline;
     100                    boolean isCoastline2 = es2.coastline;
    99101                    if (layer1 == null ? layer2 != null : !layer1.equals(layer2))
    100102                        continue;
     
    104106                    if (isTram1 && "tram".equals(railway2)) continue;
    105107
    106                     boolean isCoastline2 = coastline2 != null && (coastline2.equals("water") || coastline2.equals("coastline"));
    107108                    if (isCoastline1 != isCoastline2) continue;
    108109
     
    170171
    171172        /** The coastline type */
    172         public String coastline;
     173        public boolean coastline;
    173174
    174175        /**
     
    177178         * @param layer The layer of the way this segment is in
    178179         * @param railway The railway type of the way this segment is in
    179          * @param coastline The coastline typo of the way the segment is in
     180         * @param coastline The coastline flag of the way the segment is in
    180181         */
    181         public ExtendedSegment(WaySegment ws, String layer, String railway, String coastline) {
     182        public ExtendedSegment(WaySegment ws, String layer, String railway, boolean coastline) {
    182183            this.ws = ws;
    183184            this.n1 = ws.way.getNodes().get(ws.lowerIndex);
Note: See TracChangeset for help on using the changeset viewer.