Ticket #4146: FixDownloadIncompleteWays.patch
File FixDownloadIncompleteWays.patch, 3.6 KB (added by , 15 years ago) |
---|
-
src/org/openstreetmap/josm/data/osm/DataSetMerger.java
144 144 Way myWay = (Way)getMergeTarget(other); 145 145 if (myWay == null) 146 146 throw new RuntimeException(tr("Missing merge target for way with id {0}", other.getUniqueId())); 147 myWay.setHasIncompleteNodes();148 147 } 149 148 150 149 /** … … 162 161 if (myNode == null) 163 162 throw new RuntimeException(tr("Missing merge target for node with id {0}", other.getUniqueId())); 164 163 if (myNode.isIncomplete() || myNode.isDeleted() || !myNode.isVisible()) return; 165 166 for (Way w: OsmPrimitive.getFilteredList(myNode.getReferrers(), Way.class)) {167 w.setHasIncompleteNodes();168 }169 164 } 170 165 171 166 /** -
src/org/openstreetmap/josm/data/osm/Way.java
25 25 */ 26 26 private Node[] nodes = new Node[0]; 27 27 private BBox bbox; 28 private boolean hasIncompleteNodes;29 28 30 29 /** 31 30 * … … 376 375 bbox = new BBox(this); 377 376 } 378 377 379 //TODO This method should not be necessary. hasIncomplete state should be updated automatically when incomplete state of nodes change 380 public void setHasIncompleteNodes() { 381 hasIncompleteNodes = false; 378 public boolean hasIncompleteNodes() { 382 379 for (Node node:getNodes()) { 383 if (node.isIncomplete()) { 384 hasIncompleteNodes = true; 385 break; 386 } 380 if (node.isIncomplete()) 381 return true; 387 382 } 383 return false; 388 384 } 389 385 390 public boolean hasIncompleteNodes() {391 return hasIncompleteNodes;392 }393 394 386 @Override 395 387 public boolean isUsable() { 396 388 return super.isUsable() && !hasIncompleteNodes(); -
src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
192 192 continue; 193 193 } 194 194 } 195 appendGeneric(member.getMember()); 195 if (!member.getMember().isIncomplete()) { 196 appendGeneric(member.getMember()); 197 } 196 198 } 197 199 return this; 198 200 } … … 374 376 375 377 protected void rememberNodesOfIncompleteWaysToLoad(DataSet from) { 376 378 for (Way w: from.getWays()) { 377 if (w. isIncomplete()) {379 if (w.hasIncompleteNodes()) { 378 380 for (Node n: w.getNodes()) { 379 381 if (n.isIncomplete()) { 380 382 nodes.add(n.getId()); -
src/org/openstreetmap/josm/io/OsmReader.java
481 481 wayNodes.add(n); 482 482 } 483 483 w.setNodes(wayNodes); 484 w.setHasIncompleteNodes();485 484 if (w.hasIncompleteNodes()) { 486 485 if (logger.isLoggable(Level.FINE)) { 487 486 logger.fine(tr("Marked way {0} with {1} nodes incomplete because at least one node was missing in the " +