- Timestamp:
- 2016-01-05T23:48:02+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/UpdatePrimitivesTask.java
r9241 r9325 92 92 if (primitive instanceof Node && !primitive.isNew()) { 93 93 reader.append(primitive); 94 } else if (primitive instanceof Way) {95 Way way = (Way) primitive;96 for (Node node: way.getNodes()) {97 if (!node.isNew()) {98 reader.append(node);99 }100 }101 94 } 102 95 } … … 107 100 for (OsmPrimitive primitive : toUpdate) { 108 101 if (primitive instanceof Way && !primitive.isNew()) { 102 // this also adds way nodes 109 103 reader.append(primitive); 110 104 } … … 116 110 for (OsmPrimitive primitive : toUpdate) { 117 111 if (primitive instanceof Relation && !primitive.isNew()) { 112 // this also adds relation members 118 113 reader.append(primitive); 119 114 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java
r9242 r9325 31 31 return OverpassServerPreference.getOverpassServer(); 32 32 } 33 34 @Override 35 protected boolean recursesDown() { 36 // see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Recurse_down_.28.3E.29 for documentation 37 // accomplished using >; in the query string above 38 return true; 39 } 33 40 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r9324 r9325 171 171 if (way == null) return this; 172 172 if (way.isNew()) return this; 173 for (Node node: way.getNodes()) {173 for (Node node: !recursesDown() ? way.getNodes() : Collections.<Node>emptyList()) { 174 174 if (!node.isNew()) { 175 175 remember(node.getPrimitiveId()); … … 190 190 if (relation.isNew()) return this; 191 191 remember(relation.getPrimitiveId()); 192 for (RelationMember member : relation.getMembers()) {192 for (RelationMember member : !recursesDown() ? relation.getMembers() : Collections.<RelationMember>emptyList()) { 193 193 if (OsmPrimitiveType.from(member.getMember()).equals(OsmPrimitiveType.RELATION)) { 194 194 // avoid infinite recursion in case of cyclic dependencies in relations … … 403 403 public Set<PrimitiveId> getMissingPrimitives() { 404 404 return missingPrimitives; 405 } 406 407 /** 408 * Whether this reader fetches nodes when loading ways, or members when loading relations. 409 * 410 * @return {@code true} if the reader recurses down 411 */ 412 protected boolean recursesDown() { 413 return false; 405 414 } 406 415
Note:
See TracChangeset
for help on using the changeset viewer.