Changeset 18223 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-10-20T21:02:10+02:00 (15 years ago)
Author:
skela
Message:

Fixed #3472 in JOSM Validator: do not complain about unconnected ways
when one of the "ways" is a barrier, a fence or a disused highway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java

    r17722 r18223  
    5151    public void startTest(ProgressMonitor monitor)
    5252    {
    53         super.startTest(monitor);
     53        super.startTest(monitor);
    5454        ways = new HashSet<MyWaySegment>();
    5555        endnodes = new HashSet<Node>();
     
    162162        private Line2D line;
    163163        public Way w;
    164         public Boolean isAbandoned = false;
    165         public Boolean isBoundary = false;
    166         public Boolean highway;
     164        public boolean isAbandoned = false;
     165        public boolean isBoundary = false;
     166        public boolean highway;
    167167
    168168        public MyWaySegment(Way w, Node n1, Node n2)
     
    170170            this.w = w;
    171171            String railway = w.get("railway");
    172             this.isAbandoned = railway != null && railway.equals("abandoned");
    173             this.highway = w.get("highway") != null || (railway != null && !isAbandoned);
    174             this.isBoundary = w.get("boundary") != null && w.get("boundary").equals("administrative") && !this.highway;
     172            String highway = w.get("highway");
     173            this.isAbandoned = "abandoned".equals(railway) || "yes".equals(w.get("disused"));
     174            this.highway = (highway != null || railway != null) && !isAbandoned;
     175            this.isBoundary = !this.highway && "administrative".equals(w.get("boundary"));
    175176            line = new Line2D.Double(n1.getEastNorth().east(), n1.getEastNorth().north(),
    176177            n2.getEastNorth().east(), n2.getEastNorth().north());
     
    193194    public void visit(Way w)
    194195    {
    195         if( !w.isUsable() )
     196        if (!w.isUsable()
     197            || w.get("barrier") != null
     198            || "cliff".equals(w.get("natural")))
    196199            return;
     200
    197201        int size = w.getNodesCount();
    198202        if(size < 2)
Note: See TracChangeset for help on using the changeset viewer.