Changeset 4059 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-04-23T20:12:16+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/Test.java
r3671 r4059 216 216 return name; 217 217 } 218 219 public boolean isCancelled() { 220 return progressMonitor.isCancelled(); 221 } 218 222 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r4058 r4059 79 79 @Override 80 80 public void endTest() { 81 //Area a = Main.ds.getDataSourceArea();82 81 Map<Node, Way> map = new HashMap<Node, Way>(); 83 //long last = -1;84 82 for (int iter = 0; iter < 1; iter++) { 85 //last = System.currentTimeMillis();86 long last_print = -1;87 int nr = 0;88 83 Collection<MyWaySegment> tmp_ways = ways; 89 84 for (MyWaySegment s : tmp_ways) { 90 nr++;91 long now = System.currentTimeMillis();92 if (now - last_print > 200) {93 //System.err.println("processing segment nr: " + nr + " of " + ways.size());94 last_print = now;95 }96 85 Collection<Node> nearbyNodes = s.nearbyNodes(mindist); 97 86 for (Node en : nearbyNodes) { … … 113 102 map.put(en, s.w); 114 103 } 115 }116 //System.out.println("p1 elapsed: " + (System.currentTimeMillis()-last));117 //last = System.currentTimeMillis();104 if(isCancelled()) 105 return; 106 } 118 107 } 119 108 for (Map.Entry<Node, Way> error : map.entrySet()) { … … 125 114 map.clear(); 126 115 for (MyWaySegment s : ways) { 116 if(isCancelled()) 117 return; 127 118 for (Node en : s.nearbyNodes(mindist)) { 128 119 if (endnodes_highway.contains(en) && !s.highway && !s.isArea()) { … … 133 124 } 134 125 } 135 //System.out.println("p2 elapsed: " + (System.currentTimeMillis()-last));136 //last = System.currentTimeMillis();137 126 for (Map.Entry<Node, Way> error : map.entrySet()) { 138 127 errors.add(new TestError(this, Severity.WARNING, … … 145 134 map.clear(); 146 135 for (MyWaySegment s : ways) { 136 if(isCancelled()) 137 return; 147 138 for (Node en : s.nearbyNodes(minmiddledist)) { 148 139 if (!middlenodes.contains(en)) { … … 163 154 for (MyWaySegment s : ways) { 164 155 for (Node en : s.nearbyNodes(minmiddledist)) { 156 if(isCancelled()) 157 return; 165 158 if (!othernodes.contains(en)) { 166 159 continue;
Note:
See TracChangeset
for help on using the changeset viewer.