Changeset 15531 in josm
- Timestamp:
- 2019-11-19T11:35:34+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r15161 r15531 32 32 import org.openstreetmap.josm.data.UndoRedoHandler; 33 33 import org.openstreetmap.josm.data.osm.DataSet; 34 import org.openstreetmap.josm.data.osm.IPrimitive; 34 35 import org.openstreetmap.josm.data.osm.OsmPrimitive; 35 36 import org.openstreetmap.josm.data.osm.OsmUtils; … … 50 51 import org.openstreetmap.josm.tools.Pair; 51 52 import org.openstreetmap.josm.tools.Shortcut; 53 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 52 54 import org.openstreetmap.josm.tools.Utils; 53 55 … … 70 72 71 73 private final boolean update; 74 private static final int MAX_MEMBERS_TO_DOWNLOAD = 100; 72 75 73 76 /** … … 170 173 if (multipolygonRelation != null && editLayer != null && editLayer.isDownloadable()) { 171 174 if (!multipolygonRelation.isNew() && multipolygonRelation.isIncomplete()) { 172 MainApplication.worker .submit(173 new DownloadRelationTask(Collections.singleton(multipolygonRelation), editLayer)); 175 MainApplication.worker 176 .submit(new DownloadRelationTask(Collections.singleton(multipolygonRelation), editLayer)); 174 177 } else if (multipolygonRelation.hasIncompleteMembers()) { 175 MainApplication.worker.submit(new DownloadRelationMemberTask(multipolygonRelation, 176 Utils.filteredCollection( 177 DownloadSelectedIncompleteMembersAction.buildSetOfIncompleteMembers( 178 Collections.singleton(multipolygonRelation)), OsmPrimitive.class), 179 editLayer)); 178 // with complex relations the download of the full relation is much faster than download of almost all members, see #18341 179 SubclassFilteredCollection<IPrimitive, OsmPrimitive> incompleteMembers = Utils 180 .filteredCollection(DownloadSelectedIncompleteMembersAction.buildSetOfIncompleteMembers( 181 Collections.singleton(multipolygonRelation)), OsmPrimitive.class); 182 183 if (incompleteMembers.size() <= MAX_MEMBERS_TO_DOWNLOAD) { 184 MainApplication.worker 185 .submit(new DownloadRelationMemberTask(multipolygonRelation, incompleteMembers, editLayer)); 186 } else { 187 MainApplication.worker 188 .submit(new DownloadRelationTask(Collections.singleton(multipolygonRelation), editLayer)); 189 190 } 180 191 } 181 192 }
Note:
See TracChangeset
for help on using the changeset viewer.