Ticket #20633: 20633.patch

File 20633.patch, 1.2 KB (added by GerdP, 5 years ago)
  • src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

     
    442442     * @see #getMissingPrimitives()
    443443     */
    444444    private void downloadRelations(ProgressMonitor progressMonitor) throws OsmTransferException {
     445        boolean removeIncomplete = outputDataSet.isEmpty();
    445446        Set<Long> toDownload = new LinkedHashSet<>(relations);
    446447        fetchPrimitives(toDownload, OsmPrimitiveType.RELATION, progressMonitor);
    447448        if (!recurseDownRelations) {
     
    449450        }
    450451        // OSM multi-fetch api may return invisible objects, we don't try to get details for them
    451452        for (Relation r : outputDataSet.getRelations()) {
    452             if (!r.isVisible())
     453            if (!r.isVisible()) {
    453454                toDownload.remove(r.getUniqueId());
     455            } else if (removeIncomplete) {
     456                outputDataSet.removePrimitive(r);
     457            }
    454458        }
     459
    455460        // fetch full info for all visible relations
    456461        for (long id : toDownload) {
    457462            if (isCanceled())