Skip to content

feat(tiles): show the most important places at coarse zooms - #854

Merged
brawer merged 1 commit into
mainfrom
tiles-importance
Oct 26, 2026
Merged

brawer merged 1 commit into
mainfrom
tiles-importance

Conversation

@brawer

@brawer brawer commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Makes coarse zooms of both tile sets show the most important places, using the importance column from #853. Part of #713.

What changes

  • The conflated.pmtiles overview (z0–12) gets an importance property and the edit suggestions in diffed-places.pmtiles get @importance. Both are rounded to two decimals, so a tile holds at most 101 distinct values.
  • A tippecanoe feature filter (-j) on that property decides what each coarse zoom shows. z0 shows the top 1% (>= 0.99), z1 4% (>= 0.96), z2 16% (>= 0.84) and z3 64% (>= 0.36). From z4 on, everything is shown. The share grows four times per zoom because each tile splits into four, so features per tile stay about the same.
  • Random dot-dropping is off for these two builds (-r 1 instead of -r 1.2), so importance alone decides what coarse zooms show. --drop-densest-as-needed remains the safety net for oversized tiles.
  • The detail pass (z13–16) is unchanged.

A per-feature "tippecanoe": {"minzoom": N} would have been the obvious approach. With tippecanoe v2.49, though, it made tippecanoe drop nearly all features at every zoom: in a Swiss test, 2 of 1,436 survived at z0. I didn't find the root cause, so this PR uses the filter.

Swiss test run

Features per zoom in the conflated overview:

z0 z1 z2 z3 z4 z6 z12
main 1,436 1,724 2,069 2,484 2,983 4,332 14,941
this PR 314 934 3,393 12,690 19,663 19,740 23,438

The lowest importance shown at z0 is 0.99. The top spiders at z0 are stadt_zuerich_ch, starbucks_eu, soeder_ch, mcdonalds and rotpunkt_apotheken_ch. In diffed-places.pmtiles, z0 shows 67 features and z2 770, with the lowest at z2 being 0.84.

Note that z4–z12 now hold more features than before, since dot-dropping is off. On the planet, --drop-densest-as-needed will thin out dense tiles there.

Tests

cargo test and cargo clippy --all-targets pass. New unit tests cover the filter, the thresholds, rounding, and both GeoJSON writers. The integration test checks @importance on edit features.


Generated by Claude Code

conflated.pmtiles' overview and diffed-places.pmtiles now carry each
row's importance, rounded to two decimals, and a tippecanoe feature
filter on it decides what coarse zooms show: the top 1% at z0, four
times as many per zoom above that, and everything from z4 on. Random
dot-dropping is off for these two builds (-r 1); --drop-densest-as-needed
stays as the safety net for oversized tiles.

A per-feature "tippecanoe": {"minzoom": N} would have been simpler,
but with tippecanoe v2.49 it made tippecanoe drop nearly all features.

Part of #713.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Nw5ZNMD34EwRUnASRv4jy
@brawer brawer self-assigned this Oct 26, 2026
@brawer brawer changed the title Show the most important places at coarse tile zooms feat(tiles): show the most important places at coarse zooms Oct 26, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Oct 26, 2026
@brawer
brawer merged commit 2f85f6d into main Oct 26, 2026
7 of 10 checks passed
@brawer
brawer deleted the tiles-importance branch October 26, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants