Modify

Opened 4 years ago

Closed 4 years ago

#3465 closed defect (fixed)

Map repaint and selection slow with large datasets

Reported by: singularita@… Owned by: team
Priority: normal Component: Core
Version: Keywords:
Cc: dave@…

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 Dave Hansen <dave@…> 4 years ago.
QuadBuckets patch
QuadBuckets-as-node-storage.patch (1.3 KB) - added by Dave Hansen <dave@…> 4 years ago.
use quadbuckets to store nodes

Download all attachments as: .zip

Change History (5)

comment:1 Changed 4 years ago by Gubaer

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 Changed 4 years ago by Dave Hansen <dave@…>

  • Cc dave@… added

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

Changed 4 years ago by Dave Hansen <dave@…>

QuadBuckets patch

Changed 4 years ago by Dave Hansen <dave@…>

use quadbuckets to store nodes

comment:3 Changed 4 years ago by Gubaer

  • Resolution set to fixed
  • Status changed from new to 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.