Opened 16 years ago
Closed 15 years ago
#3465 closed defect (fixed)
Map repaint and selection slow with large datasets
Reported by: | bilbo | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: | hansendc |
Description
I loaded http://download.geofabrik.de/osm/europe/slovakia.osm.bz2 (~ 160 MB uncompressed) into JOSM. The initial draw took about 7 seconds (no surprise, since entire country is drawn), but once I zoom close enough to see only about 10 or 20 ways and perhaps 50 nodes, every repaint still takes about 1500 msec. When I switched from mappaint to wireframe view, it was even worse (about 2400 msec to repaint)
Redraw of same area, but from smaller dataset (dataset created from the one above by extracting only ways/nodes visible in that view) needs only about 5 msec.
MapPaintVisitor and SimplePaintVisitor seem to iterate though all ways, nodes and relations to find out what to draw. This is very ineffective.
When I click or drag anywhere in the large dataset to select something, the code needs 1000 msec to discover what it was, which is very slow. I discovered that SelectionManager.getObjectsInRectangle iterates through all primitives too.
I think some spatial index (kd-tree, or R-tree could fix the problem) should be added, so larger datasets could be also editable.
Attachments (2)
Change History (5)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Cc: | added |
---|
See the josm-dev list. I just posted some "QuadBuckets" code that may help. I'd love some testing.
by , 16 years ago
Attachment: | QuadBuckets-as-node-storage.patch added |
---|
use quadbuckets to store nodes
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This has been improved lately. I've loaded the Slovakia export with r2484. It still takes a couple of seconds to render the whole file but as soon as you zoom it painting is much faster than it used to be.
Exactly. That's what Jiri and myself have been discussing about. Apparently the former spin-of JOSM-NG had a spatial index and we should look whether we could benefit from their good work.