Ignore:
Timestamp:
2020-01-27T09:17:42+01:00 (4 years ago)
Author:
GerdP
Message:

see #18624: Download parent ways/relations downloads way nodes twice (or more)
Improve performance, esp. when multiple nodes of the same way are selected

  • DownloadReferrersTask: download all incomplete nodes of all parent ways with one MultiFetchServerObjectReader instead of repeating this step for each parent way. Saves lots of FULL api calls for the parent ways (/full)
  • updated parent way nodes are recognized
  • DownloadPrimitivesWithReferrersTask creates only one DownloadReferrersTask for all primitives to profit from the above changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java

    r15746 r15787  
    114114        currentTask.run();
    115115        // Then, download referrers for each primitive
    116         if (downloadReferrers)
    117             for (PrimitiveId id : ids) {
    118                 synchronized (this) {
    119                     if (canceled) {
    120                         currentTask = null;
    121                         return;
    122                     }
    123                     currentTask = new DownloadReferrersTask(
    124                             tmpLayer, id, getProgressMonitor().createSubTaskMonitor(1, false));
    125                 }
    126                 currentTask.run();
    127             }
     116        if (downloadReferrers) {
     117            currentTask = new DownloadReferrersTask(tmpLayer, ids);
     118            currentTask.run();
     119            synchronized (this) {
     120                if (currentTask.getProgressMonitor().isCanceled())
     121                    cancel();
     122            }
     123        }
    128124        currentTask = null;
    129125    }
Note: See TracChangeset for help on using the changeset viewer.