Changeset 6294 in josm for trunk/src/org


Ignore:
Timestamp:
2013-10-04T00:57:06+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #9142, fix #9143 - Ignore highway=proposed in CrossingWays validator test

File:
1 edited

Legend:

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

    r6240 r6294  
    7171        String landuse1 = w.get("landuse");
    7272        boolean isCoastline1 = "water".equals(natural1) || "coastline".equals(natural1) || "reservoir".equals(landuse1);
     73        String highway1 = w.get("highway");
    7374        String railway1 = w.get("railway");
    7475        boolean isSubway1 = "subway".equals(railway1);
     
    9091        for (int i = 0; i < nodesSize - 1; i++) {
    9192            WaySegment ws = new WaySegment(w, i);
    92             ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, isCoastline1, waterway1);
     93            ExtendedSegment es1 = new ExtendedSegment(ws, layer1, highway1, railway1, isCoastline1, waterway1);
    9394            for (List<ExtendedSegment> segments : getSegments(es1.n1, es1.n2)) {
    9495                for (ExtendedSegment es2 : segments) {
     
    101102
    102103                    String layer2 = es2.layer;
     104                    String highway2 = es2.highway;
    103105                    String railway2 = es2.railway;
    104106                    boolean isCoastline2 = es2.coastline;
     
    125127                    }
    126128
    127                     if (("abandoned".equals(es1.railway)) || ("abandoned".equals(railway2))) {
     129                    if ("proposed".equals(es1.highway) || "proposed".equals(highway2)
     130                     || "abandoned".equals(es1.railway) || "abandoned".equals(railway2)) {
    128131                        continue;
    129132                    }
     
    140143                        } else if ((es1.waterway != null && es2.waterway != null)) {
    141144                            message = tr("Crossing waterways");
    142                         } else if ((es1.waterway != null && es2.ws.way.get("highway") != null)
    143                                 || (es2.waterway != null && es1.ws.way.get("highway") != null)) {
     145                        } else if ((es1.waterway != null && es2.highway != null)
     146                                || (es2.waterway != null && es1.highway != null)) {
    144147                            message = tr("Crossing waterway/highway");
    145148                        } else {
     
    189192     */
    190193    public static class ExtendedSegment {
    191         private Node n1, n2;
    192 
    193         private WaySegment ws;
     194        private final Node n1, n2;
     195
     196        private final WaySegment ws;
    194197
    195198        /** The layer */
    196         private String layer;
     199        private final String layer;
     200
     201        /** The highway type */
     202        private final String highway;
    197203
    198204        /** The railway type */
    199         private String railway;
     205        private final String railway;
    200206
    201207        /** The waterway type */
    202         private String waterway;
     208        private final String waterway;
    203209
    204210        /** The coastline type */
    205         private boolean coastline;
     211        private final boolean coastline;
    206212
    207213        /**
     
    209215         * @param ws The way segment
    210216         * @param layer The layer of the way this segment is in
     217         * @param highway The highway type of the way this segment is in
    211218         * @param railway The railway type of the way this segment is in
    212219         * @param coastline The coastline flag of the way the segment is in
    213220         * @param waterway The waterway type of the way this segment is in
    214221         */
    215         public ExtendedSegment(WaySegment ws, String layer, String railway, boolean coastline, String waterway) {
     222        public ExtendedSegment(WaySegment ws, String layer, String highway, String railway, boolean coastline, String waterway) {
    216223            this.ws = ws;
    217224            this.n1 = ws.way.getNodes().get(ws.lowerIndex);
    218225            this.n2 = ws.way.getNodes().get(ws.lowerIndex + 1);
    219226            this.layer = layer;
     227            this.highway = highway;
    220228            this.railway = railway;
    221229            this.coastline = coastline;
Note: See TracChangeset for help on using the changeset viewer.