Changeset 19078 in josm for trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
- Timestamp:
- 2024-05-13T20:34:55+02:00 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r18320 r19078 7 7 import java.io.InputStream; 8 8 import java.net.SocketException; 9 import java.util.Collection; 10 import java.util.Collections; 9 11 import java.util.List; 10 12 … … 216 218 } 217 219 } 220 // From https://wiki.openstreetmap.org/wiki/API_v0.6#Retrieving_map_data_by_bounding_box:_GET_/api/0.6/map, 221 // relations are not recursed up, so they *may* have parent relations. 222 // Nodes inside the download area should have all relations and ways that refer to them. 223 // Ways should have all relations that refer to them and all child nodes, but those child nodes may not 224 // have their parent referrers. 225 // Relations will have the *first* parent relations downloaded, but those are not split out in the returns. 226 // So we always assume that a relation has referrers that need to be downloaded unless it has no child relations. 227 // Our "full" overpass query doesn't return the same data as a standard download, so we cannot 228 // mark relations with no child relations as fully downloaded *yet*. 229 if (this.considerAsFullDownload()) { 230 final Collection<Bounds> bounds = this.getBounds(); 231 // We cannot use OsmPrimitive#isOutsideDownloadArea yet since some download methods haven't added 232 // the download bounds to the dataset yet. This is specifically the case for overpass downloads. 233 ds.getNodes().stream().filter(n -> bounds.stream().anyMatch(b -> b.contains(n))) 234 .forEach(i -> i.setReferrersDownloaded(true)); 235 ds.getWays().forEach(i -> i.setReferrersDownloaded(true)); 236 } 218 237 return ds; 219 238 } catch (OsmTransferException e) { … … 280 299 } 281 300 301 /** 302 * Get the bounds for this downloader 303 * @return The bounds for this downloader 304 * @since xxx 305 */ 306 protected Collection<Bounds> getBounds() { 307 return Collections.singleton(new Bounds(this.lat1, this.lon1, this.lat2, this.lon2)); 308 } 282 309 }
Note:
See TracChangeset
for help on using the changeset viewer.