Changeset 2609 in josm


Ignore:
Timestamp:
2009-12-11T20:24:41+01:00 (15 years ago)
Author:
stoecker
Message:

applied #4146 - patch by mjulius - fix downloading incomplete relation

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r2591 r2609  
    145145        if (myWay == null)
    146146            throw new RuntimeException(tr("Missing merge target for way with id {0}", other.getUniqueId()));
    147         myWay.setHasIncompleteNodes();
    148147    }
    149148
     
    163162            throw new RuntimeException(tr("Missing merge target for node with id {0}", other.getUniqueId()));
    164163        if (myNode.isIncomplete() || myNode.isDeleted() || !myNode.isVisible()) return;
    165 
    166         for (Way w: OsmPrimitive.getFilteredList(myNode.getReferrers(), Way.class)) {
    167             w.setHasIncompleteNodes();
    168         }
    169164    }
    170165
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r2591 r2609  
    2626    private Node[] nodes = new Node[0];
    2727    private BBox bbox;
    28     private boolean hasIncompleteNodes;
    2928
    3029    /**
     
    377376    }
    378377
    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() {
    382379        for (Node node:getNodes()) {
    383             if (node.isIncomplete()) {
    384                 hasIncompleteNodes = true;
    385                 break;
    386             }
    387         }
    388     }
    389 
    390     public boolean hasIncompleteNodes() {
    391         return hasIncompleteNodes;
     380            if (node.isIncomplete())
     381                return true;
     382        }
     383        return false;
    392384    }
    393385
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r2599 r2609  
    193193                }
    194194            }
    195             appendGeneric(member.getMember());
     195            if (!member.getMember().isIncomplete()) {
     196                appendGeneric(member.getMember());
     197            }
    196198        }
    197199        return this;
     
    375377    protected void rememberNodesOfIncompleteWaysToLoad(DataSet from) {
    376378        for (Way w: from.getWays()) {
    377             if (w.isIncomplete()) {
     379            if (w.hasIncompleteNodes()) {
    378380                for (Node n: w.getNodes()) {
    379381                    if (n.isIncomplete()) {
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r2604 r2609  
    482482            }
    483483            w.setNodes(wayNodes);
    484             w.setHasIncompleteNodes();
    485484            if (w.hasIncompleteNodes()) {
    486485                if (logger.isLoggable(Level.FINE)) {
Note: See TracChangeset for help on using the changeset viewer.