Ignore:
Timestamp:
05.02.2010 20:52:53 (2 years ago)
Author:
mjulius
Message:

fixes #4441 - error downloading/sync
when updating data round bounding boxes to LatLon.MAX_SERVER_PRECISION and really eliminate empty download areas before downloading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java

    r2711 r2942  
    22package org.openstreetmap.josm.actions; 
    33 
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 
    45import static org.openstreetmap.josm.tools.I18n.tr; 
    5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 
    66 
    77import java.awt.event.ActionEvent; 
     
    5151            return; 
    5252 
    53         int bboxCount = 0; 
    5453        List<Area> areas = new ArrayList<Area>(); 
    5554        for(DataSource ds : getEditLayer().data.dataSources) { 
    56             areas.add(new Area(ds.bounds.asRect())); 
     55            areas.add(new Area(ds.bounds.getRoundedToOsmPrecision().asRect())); 
    5756        } 
    5857 
     
    7372        } 
    7473 
     74        List<Area> areasToDownload = new ArrayList<Area>(); 
    7575        for(Area a : areas) { 
    7676            if(a.isEmpty()) { 
    7777                continue; 
    7878            } 
    79             bboxCount++; 
     79            areasToDownload.add(a); 
    8080        } 
    8181 
    82         if(bboxCount == 0) { 
     82        if(areasToDownload.isEmpty()) { 
    8383            // no bounds defined in the dataset? we update all primitives in the data set 
    8484            // using a series of multi fetch requests 
     
    8989            // 
    9090            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); 
    9292            Main.worker.submit( 
    9393                    new Runnable() { 
Note: See TracChangeset for help on using the changeset viewer.