A basemap's capital labels collide at low zooms — Luxembourg, Brussels and Amsterdam draw on top of each other — and the style engineer wants to cluster them below some zoom and show one label per capital above it. The rule the tiler supports is per-tile: cluster while any tile holds more than one capital. The engineer wants the numbers from the data rather than a guess.
Assign each of the 200 national capitals to its XYZ tile (256 px Web Mercator) at zooms 2 to 12 and report:
max_per_tile_z3 — the most capitals in one tile at zoom 3max_per_tile_z5 — at zoom 5max_per_tile_z7 — at zoom 7first_zoom_alone — the lowest zoom at which every capital is alone in its tileTile indices follow the standard formulas:
x = floor((lon + 180) / 360 · 2^z)
y = floor((1 − ln(tan φ + sec φ) / π) / 2 · 2^z)These are where the teaching is. Read them twice.
Per-tile occupancy is how vector-tile label layers decide their cluster and reveal zooms, and measuring it on the real point set is what stops a style from hiding half a continent's capitals.
Work the problem in whatever tool you like, then enter the answers here.
max_per_tile_z3max_per_tile_z5max_per_tile_z7first_zoom_alone4 scored, 0 informational
Busiest tile at zoom 3
20%Busiest tile at zoom 5
20%Busiest tile at zoom 7
20%First zoom with every capital alone
40%