Changeset 15340 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-09-09T19:54:43+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r15205 r15340 21 21 22 22 import org.openstreetmap.josm.actions.downloadtasks.DownloadTaskList; 23 import org.openstreetmap.josm.data.Bounds; 23 24 import org.openstreetmap.josm.data.coor.LatLon; 25 import org.openstreetmap.josm.data.osm.DataSet; 24 26 import org.openstreetmap.josm.gui.MainApplication; 25 27 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 87 89 addToDownload(tmp, r2, results, maxArea); 88 90 } else { 91 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 92 if (ds != null) { 93 Collection<Bounds> existing = ds.getDataSourceBounds(); 94 if (existing != null) { 95 double p = LatLon.MAX_SERVER_PRECISION; 96 LatLon min = new LatLon(bounds.getY()+p, bounds.getX()+p); 97 LatLon max = new LatLon(bounds.getY()+bounds.getHeight()-p, bounds.getX()+bounds.getWidth()-p); 98 if(existing.stream().anyMatch(current -> (current.contains(min) && current.contains(max)))) { 99 return; /* skip this one, already downloaded */ 100 } 101 } 102 } 89 103 results.add(bounds); 90 104 } … … 102 116 * that goes like this: +----+ | /| | / | | / | |/ | +----+ then we would first look at 103 117 * downloading the whole rectangle (assume it's too big), after that we split it in half 104 * (upper and lower half), but we do not request the full upper and lower rectangle, only118 * (upper and lower half), but we do not request the full upper and lower rectangle, only 105 119 * the part of the upper/lower rectangle that actually has something in it. 106 120 *
Note:
See TracChangeset
for help on using the changeset viewer.