Changeset 2942 in josm for trunk/src/org
- Timestamp:
- 2010-02-05T20:52:53+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
r2711 r2942 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;6 6 7 7 import java.awt.event.ActionEvent; … … 51 51 return; 52 52 53 int bboxCount = 0;54 53 List<Area> areas = new ArrayList<Area>(); 55 54 for(DataSource ds : getEditLayer().data.dataSources) { 56 areas.add(new Area(ds.bounds. asRect()));55 areas.add(new Area(ds.bounds.getRoundedToOsmPrecision().asRect())); 57 56 } 58 57 … … 73 72 } 74 73 74 List<Area> areasToDownload = new ArrayList<Area>(); 75 75 for(Area a : areas) { 76 76 if(a.isEmpty()) { 77 77 continue; 78 78 } 79 bboxCount++;79 areasToDownload.add(a); 80 80 } 81 81 82 if( bboxCount == 0) {82 if(areasToDownload.isEmpty()) { 83 83 // no bounds defined in the dataset? we update all primitives in the data set 84 84 // using a series of multi fetch requests … … 89 89 // 90 90 final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data")); 91 final Future<?> future = new DownloadOsmTaskList().download(false /* no new layer */, areas , monitor);91 final Future<?> future = new DownloadOsmTaskList().download(false /* no new layer */, areasToDownload, monitor); 92 92 Main.worker.submit( 93 93 new Runnable() { -
trunk/src/org/openstreetmap/josm/data/Bounds.java
r2941 r2942 241 241 } 242 242 243 /** 244 * Returns a clone of this Bounds, rounded to OSM precisions, i.e. to 245 * LatLon.MAX_SERVER_PRECISION 246 * 247 * @return a clone of this Bounds 248 */ 249 public Bounds getRoundedToOsmPrecision() { 250 return new Bounds( 251 Math.round(minLat / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION, 252 Math.round(minLon / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION, 253 Math.round(maxLat / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION, 254 Math.round(maxLon / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION 255 ); 256 } 243 257 }
Note:
See TracChangeset
for help on using the changeset viewer.