Changeset 10774 in osm for applications/editors/josm/plugins/validator
- Timestamp:
- 2008-09-18T15:19:34+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateNode.java
r9684 r10774 138 138 } 139 139 140 cmds.add( new DeleteCommand(nodes));140 cmds.add(DeleteCommand.delete(nodes)); 141 141 cmds.add(new ChangeCommand(target, newtarget)); 142 142 return new SequenceCommand(tr("Merge Nodes"), cmds); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicatedWayNodes.java
r9684 r10774 58 58 if (wnew.nodes.size() < 2) { 59 59 // Empty way, delete 60 return new DeleteCommand(Collections.singleton(w));60 return DeleteCommand.delete(Collections.singleton(w)); 61 61 } else { 62 62 return new ChangeCommand(w, wnew); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java
r10526 r10774 30 30 Set<MyWaySegment> ways; 31 31 Set<Node> endnodes; // nodes at end of way 32 Set<Node> endnodes_highway; // nodes at end of way 32 33 Set<Node> middlenodes; // nodes in middle of way 33 34 Set<Node> othernodes; // nodes appearing at least twice … … 49 50 ways = new HashSet<MyWaySegment>(); 50 51 endnodes = new HashSet<Node>(); 52 endnodes_highway = new HashSet<Node>(); 51 53 middlenodes = new HashSet<Node>(); 52 54 othernodes = new HashSet<Node>(); … … 59 61 { 60 62 Map<Node, Way> map = new HashMap<Node, Way>(); 63 for(Node en : endnodes_highway) 64 { 65 for(MyWaySegment s : ways) 66 { 67 if(s.highway && s.nearby(en, mindist)) 68 map.put(en, s.w); 69 } 70 } 71 if(map.size() > 0) 72 { 73 for(Map.Entry<Node, Way> error : map.entrySet()) 74 { 75 errors.add(new TestError(this, Severity.WARNING, 76 tr("Way end node near other highway"), UNCONNECTED_WAYS, 77 Arrays.asList(error.getKey(), error.getValue()))); 78 } 79 } 80 map.clear(); 81 for(Node en : endnodes_highway) 82 { 83 for(MyWaySegment s : ways) 84 { 85 if(!s.highway && s.nearby(en, mindist)) 86 map.put(en, s.w); 87 } 88 } 61 89 for(Node en : endnodes) 62 90 { … … 124 152 private Line2D line; 125 153 public Way w; 154 public Boolean highway; 126 155 127 156 public MyWaySegment(Way w, Node n1, Node n2) 128 157 { 129 158 this.w = w; 159 this.highway = w.get("highway") != null || w.get("railway") != null; 130 160 line = new Line2D.Double(n1.eastNorth.east(), n1.eastNorth.north(), 131 161 n2.eastNorth.east(), n2.eastNorth.north()); … … 153 183 ways.add(new MyWaySegment(w, w.nodes.get(i-1), w.nodes.get(i))); 154 184 } 155 addNode(w.nodes.get(0), endnodes); 156 addNode(w.nodes.get(size-1), endnodes); 185 Set<Node> set = endnodes; 186 if(w.get("highway") != null || w.get("railway") != null) 187 set = endnodes_highway; 188 addNode(w.nodes.get(0), set); 189 addNode(w.nodes.get(size-1), set); 157 190 } 158 191 private void addNode(Node n, Set<Node> s) … … 160 193 Boolean m = middlenodes.contains(n); 161 194 Boolean e = endnodes.contains(n); 195 Boolean eh = endnodes_highway.contains(n); 162 196 Boolean o = othernodes.contains(n); 163 if(!m && !e && !o )197 if(!m && !e && !o && !eh) 164 198 s.add(n); 165 199 else if(!o) … … 168 202 if(e) 169 203 endnodes.remove(n); 204 else if(eh) 205 endnodes_highway.remove(n); 170 206 else 171 207 middlenodes.remove(n); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedNode.java
r9891 r10774 94 94 public Command fixError(TestError testError) 95 95 { 96 return new DeleteCommand(testError.getPrimitives());96 return DeleteCommand.delete(testError.getPrimitives()); 97 97 } 98 98 -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedWay.java
r9891 r10774 110 110 public Command fixError(TestError testError) 111 111 { 112 return new DeleteCommand(testError.getPrimitives());112 return DeleteCommand.delete(testError.getPrimitives()); 113 113 } 114 114 }
Note:
See TracChangeset
for help on using the changeset viewer.