Closed nvkelso closed 1 year ago
Consider moving the sortKey transform to post processing step...
Consider also varying the number of kept features by zoom (or limiting the size of the grid by zoom) – and limiting to just locality
kinds.
Right now we do a combination:
feat.setPointLabelGridSizeAndLimit(13, 64, 4); // each cell in the 4x4 grid can have 4 items
But we could split that apart so the Size is constant but the limit varies by zoom:
feat.setPointLabelGridLimit(LOCALITY_GRID_LIMIT_ZOOM_FUNCTION);
or
feat.setPointLabelGridSize(LOCALITY_GRID_SIZE_ZOOM_FUNCTION);
Where LOCALITY_GRID_LIMIT_ZOOM_FUNCTION might look like:
private static final ZoomFunction<Number> LOCALITY_GRID_LIMIT_ZOOM_FUNCTION = ZoomFunction.fromMaxZoomThresholds(Map.of(
7, 2,
8, 4,
9, 6,
10, 8
11, 10
), 0);
With the zoom breaks adapted from Tilezen, where no thinning is done from zoom 0 to 6 inclusive (as Natural Earth is pre-compiled).
It's unclear if you can limit the label grid to apply to certain features versus all features in a layer (eg just locality
kinds).
label grid applies to all features in a layer. another option is just making buckets way bigger at low zooms and then doing some post-processing
This is especially bad at zooms 2 and 3 in the USA.
Likely part of the label thinning for
places
layer. Perhaps that should be limited tolocality
andneighbourhood
features only?Zoom 2:
Zoom 3: