﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
14572	Don't index MultipolygonCache by NavigatableComponent	michael2402	Don-vip	"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)."	enhancement	closed	normal	17.03	Core mappaint		fixed	MultipolygonCache	Don-vip
