Modify

Opened 7 months ago

Closed 7 months ago

#14572 closed enhancement (fixed)

Don't index MultipolygonCache by NavigatableComponent

Reported by: michael2402 Owned by: Don-vip
Priority: normal Milestone: 17.03
Component: Core mappaint Version:
Keywords: MultipolygonCache Cc: Don-vip

Description

Currently, the multipolygon cache is indexed by:

  • The navigatable component
  • The data set
  • The relation.

I'd suggest changing this to remove the Navigatable component requirement. The nc is never used when building the polygon data. It is just used for clearing - but the cache should be cleared automatically when the data sets are removed.

We could then add two new methods:

public Multipolygon get(Relation r);
public Multipolygon forceRefresh(Relation r);

It might make sense to index the cache by projection - since some relation tests (intersections, ...) depend on the projection used. But I'd rather move this to the PolyData class - that class currently does the LatLon->EastNorth conversion for multipolygons and caches it. We might even remove it some day, since we do a lot of extra work in the GUI (clamping, ...) that does not allow us to use the cached polygons directly. It would not cause a speed decrease if we directly iterate over the nodes and use their cached East/North values instead.

Is there any reason the cache is indexed by NC?

(Background: I'm currently working on the style parsing tests (StyleCacheTest, MapCSSRendererTest, ...) and there are dependencies on Main.map in :closed and other parts just because of this issue. We could run tests without registering the map frame if it was not required by the MultipolygonCache - which would allow us to start with a cleaner state).

Attachments (0)

Change History (2)

comment:1 Changed 7 months ago by Don-vip

Owner: changed from team to Don-vip
Status: newassigned

comment:2 Changed 7 months ago by Don-vip

Resolution: fixed
Status: assignedclosed

In 11779/josm:

fix #14572 - Don't index MultipolygonCache by NavigatableComponent

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.