Changeset 7501 in josm for trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
- Timestamp:
- 2014-09-05T14:45:30+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
r7500 r7501 9 9 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.data.coor.LatLon;12 11 import org.openstreetmap.josm.tools.Utils; 13 12 … … 105 104 public void searchNodes() { 106 105 long startTime = System.currentTimeMillis(); 107 for (Node n : dataSet.getNodes()) {108 if (!n.isIncomplete() && !n.isDeleted()){109 LatLon c = n.getCoor();110 if (c != null) {111 BBox box = c.toBBox(0.0001);112 if (!dataSet.searchNodes(box).contains(n)) {113 printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n);114 115 }116 }106 dataSet.getReadLock().lock(); 107 try { 108 for (Node n : dataSet.getNodes()) { 109 // Call isDrawable() as an efficient replacement to previous checks (!deleted, !incomplete, getCoor() != null) 110 if (n.isDrawable() && !dataSet.containsNode(n)) { 111 printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n); 112 } 113 } 114 } finally { 115 dataSet.getReadLock().unlock(); 117 116 } 118 117 printElapsedTime(startTime); … … 124 123 public void searchWays() { 125 124 long startTime = System.currentTimeMillis(); 126 for (Way w : dataSet.getWays()) { 127 if (!w.isIncomplete() && !w.isDeleted() && w.getNodesCount() >= 2 && !dataSet.searchWays(w.getBBox()).contains(w)) { 128 printError("SEARCH WAYS", "%s not found using Dataset.searchWays()", w); 129 } 125 dataSet.getReadLock().lock(); 126 try { 127 for (Way w : dataSet.getWays()) { 128 if (!w.isIncomplete() && !w.isDeleted() && w.getNodesCount() >= 2 && !dataSet.containsWay(w)) { 129 printError("SEARCH WAYS", "%s not found using Dataset.searchWays()", w); 130 } 131 } 132 } finally { 133 dataSet.getReadLock().unlock(); 130 134 } 131 135 printElapsedTime(startTime);
Note:
See TracChangeset
for help on using the changeset viewer.