Modify

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)

QuadBuckets.patch (39.0 KB ) - added by hansendc 16 years ago.
QuadBuckets patch
QuadBuckets-as-node-storage.patch (1.3 KB ) - added by hansendc 16 years ago.
use quadbuckets to store nodes

Download all attachments as: .zip

Change History (5)

comment:1 by Gubaer, 16 years ago

I think some spatial index (kd-tree, or R-tree could fix the problem) should be added, so larger datasets could be also editable.

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.

comment:2 by hansendc, 16 years ago

Cc: hansendc added

See the josm-dev list. I just posted some "QuadBuckets" code that may help. I'd love some testing.

by hansendc, 16 years ago

Attachment: QuadBuckets.patch added

QuadBuckets patch

by hansendc, 16 years ago

use quadbuckets to store nodes

comment:3 by Gubaer, 15 years ago

Resolution: fixed
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.