Modify ↓
Opened 9 months ago
Closed 9 months ago
#23830 closed defect (fixed)
[PATCH] Slow selection when there is a lot of data
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 24.08 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
It turns out that SelectionManager
iterates through all nodes and all ways when we are making a selection.
This is not ideal when working with large datasets.
-
src/org/openstreetmap/josm/gui/SelectionManager.java
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 diff --git a/src/org/openstreetmap/josm/gui/SelectionManager.java b/src/org/openstreetmap/josm/gui/SelectionManager.java
a b 19 19 20 20 import org.openstreetmap.josm.actions.SelectByInternalPointAction; 21 21 import org.openstreetmap.josm.data.Bounds; 22 import org.openstreetmap.josm.data.osm.BBox; 22 23 import org.openstreetmap.josm.data.osm.DataSet; 23 24 import org.openstreetmap.josm.data.osm.Node; 24 25 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 382 383 selection.add(osm); 383 384 } 384 385 } else if (ds != null) { 386 final BBox bbox = nc.getLatLonBounds(bounding).toBBox(); 385 387 // nodes 386 for (Node n : ds. getNodes()) {388 for (Node n : ds.searchNodes(bbox)) { 387 389 if (n.isSelectable() && selectionResult.contains(nc.getPoint2D(n))) { 388 390 selection.add(n); 389 391 } 390 392 } 391 393 392 394 // ways 393 for (Way w : ds. getWays()) {395 for (Way w : ds.searchWays(bbox)) { 394 396 if (!w.isSelectable() || w.isEmpty()) { 395 397 continue; 396 398 }
Attachments (0)
Note:
See TracTickets
for help on using tickets.
In 19167/josm: