- Timestamp:
- 2020-03-03T08:00:14+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java
r15811 r16008 35 35 case MULTIPOLYGON: 36 36 case RELATION: 37 sb.append(list); 38 if (recurseDownRelations) 39 sb.append(">>;"); 37 if (recurseDownRelations) { 38 sb.append('(').append(list); 39 sb.setLength(sb.length()-1); // remove semicolon 40 //recurse down only one level, see #18835 41 sb.append("->.r;.r;rel(r);.r;way(r);>;.r;node(r););"); 42 } else { 43 sb.append(list); 44 } 40 45 break; 41 46 case CLOSEDWAY: -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r15846 r16008 446 446 return; 447 447 } 448 // OSM multi-fetch api may return invisible objects 448 // OSM multi-fetch api may return invisible objects, we don't try to get details for them 449 449 for (Relation r : outputDataSet.getRelations()) { 450 450 if (!r.isVisible()) 451 451 toDownload.remove(r.getUniqueId()); 452 452 } 453 while (!toDownload.isEmpty()) { 453 // fetch full info for all visible relations 454 for (long id : toDownload) { 454 455 if (isCanceled()) 455 456 return; 456 final Set<Long> addedRelations = new LinkedHashSet<>(); 457 458 for (long id : toDownload) { 459 OsmServerObjectReader reader = new OsmServerObjectReader(id, OsmPrimitiveType.RELATION, true /* full*/); 460 DataSet ds = reader.parseOsm(progressMonitor.createSubTaskMonitor(1, false)); 461 if (ds != null) { 462 ds.getRelations().stream().map(OsmPrimitive::getUniqueId).filter(uid -> uid != id) 463 .forEach(addedRelations::add); 464 } 465 merge(ds); 466 } 467 if (addedRelations.isEmpty()) 468 break; 469 toDownload = addedRelations; 457 OsmServerObjectReader reader = new OsmServerObjectReader(id, OsmPrimitiveType.RELATION, true/* full*/); 458 DataSet ds = reader.parseOsm(progressMonitor.createSubTaskMonitor(1, false)); 459 merge(ds); 470 460 } 471 461 } … … 484 474 /** 485 475 * Should downloaded relations be complete? 486 * @param recurseDownRelations true: yes, recurse down to retrieve the complete relation 476 * @param recurseDownRelations true: yes, recurse down to retrieve the members of the relation 477 * This will download sub relations, complete way members and nodes. Members of sub relations are not 478 * retrieved unless they are also members of the relations. See #18835. 487 479 * @return this 488 480 * @since 15811
Note:
See TracChangeset
for help on using the changeset viewer.