[josm-dev] JOSM Mappaint - major improvements
Dirk Stöcker
openstreetmap at dstoecker.de
Tue Jan 13 13:02:46 GMT 2009
On Tue, 13 Jan 2009, Frederik Ramm wrote:
>> That's to be expected. Even with a spatial index (AFAIK josm still
>> doesn't use one yet), looking up the objects inside a give bounding box
>> ("the view") is dependant on the total number of objects. For example, a
>> 2D-PR-Tree lookup is about O(sqrt(n)) [1], with n being the total number
>> of objects stored in the tree.
>> If some genius invents a spatial index with lookup in O(1), I'm sure
>> we'll hear about it. :)
>
> It would be trivial to create a list of objects that are currently
> visible, and renew this list each time the viewport changes. In this
> case, the redrawing speed would be directly proportional to the number
> (and complexity) of items in view, no matter how many objects are
> loaded. Only viewport changes would require re-calculating the visible
> objects list.
That would be easy for encapsulated data access. For current JOSM it will
be lots of work.
I will see what my idea to cache the visible state brings. Then the
visibility check is a lot less CPU consuming than the current method. That
may help (and also brings the multipolygon painting back).
Ciao
--
http://www.dstoecker.eu/ (PGP key available)
More information about the josm-dev
mailing list