Figure

The tile pyramid, four levels down to quadkey 120

Drawn here at the parameters it defaults to, with every essay that calls it.
The tile pyramid, four levels down to quadkey 120. The world as a square, quartered three times. Each level's tile is exactly half the width of its parent, so a tile is four tiles at the next level and never needs resampling to serve one — the property the whole scheme rests on, and one that holds only because the projected world is square. Level 3 has 64 tiles at 19567.9 metres per pixel, which at 51.5° north is 12181.3 metres of ground per pixel rather than the number the scheme publishes.

The world as a square, quartered three times. Each level's tile is exactly half the width of its parent, so a tile is four tiles at the next level and never needs resampling to serve one — the property the whole scheme rests on, and one that holds only because the projected world is square. Level 3 has 64 tiles at 19567.9 metres per pixel, which at 51.5° north is 12181.3 metres of ground per pixel rather than the number the scheme publishes.

It is drawn by screen-figure with show: "tile-pyramid" — one member of a family of 12 figures that share a generator, so the drawing above is what that generator returns when it is asked for this one and given nothing else.

10 essays call it. Every call below passes it something, because a placement that passes nothing draws whichever member of the family the generator happens to default to rather than the one its essay argues about.

Where it is called

Changing this changes every one of these figures.

The tile pyramid, four levels down to quadkey 120. The world as a square, quartered three times. Each level's tile is exactly half the width of its parent, so a tile is four tiles at the next level and never needs resampling to serve one — the property the whole scheme rests on, and one that holds only because the projected world is square. Level 3 has 64 tiles at 19567.9 metres per pixel, which at 51.5° north is 12181.3 metres of ground per pixel rather than the number the scheme publishes. What a machine does with it

A screen map is a pyramid of tiles

The scheme every slippy map runs on is a coordinate system with three integers and one projection, and almost all of it is forced. A square world is what makes the quadtree work, the levels are exact powers of two, and the published resolution — 156,543 metres per pixel at zoom zero — is a distance on the ground at exactly one latitude.

What "1:136,495" means at each latitude, at zoom 12. A screen map at zoom 12 prints one scale for the whole world. The curve is how much larger in scale the map really is, measured from the projection's own derivatives rather than from a formula: at 60° it is 1.98 times, so the map labelled 1:136,495 is a 1:68,765 map. The hollow marks are sec φ, the textbook answer. They do not sit on the curve — the worst gap is 9949 parts per million at 85° — because Web Mercator puts a geodetic latitude into a spherical formula, and the same spherical Mercator measured the same way reproduces sec φ exactly. What a machine does with it

The scale of a screen map is not one number

A zoom level prints one scale for the whole world, and the map is at that scale along exactly one line. At 60° north the picture labelled 1:136,495 is a 1:68,765 map — and the factor is not quite sec φ either, because the projection puts a geodetic latitude into a spherical formula.

The cut at 85.0511°, and the alternatives that are not square. Mercator's northing runs to infinity at the pole, so a tiling has to stop somewhere, and the latitude is not a rounding: 85.0511° is where the northing equals half the world's width, which is the only cut that makes the projected world a square. The bars are what other cuts would give — at 89° the world is 1.51 times as tall as it is wide, and a single square root tile cannot cover it. The price is 0.373 per cent of the Earth's surface, 1,901,487 square kilometres in two caps, computed from 2πR²(1 − sin φ) rather than estimated. What a machine does with it

The square costs the poles

The cut at 85.0511287798° is the most-quoted number in web mapping and is almost never derived. It is where Mercator's northing equals half the world's width — the condition for a square — and it drops 1,901,487 square kilometres. A two-tile root would have reached 89.786° and dropped 3,558.

A feature across nine tiles at zoom 4, and the nine labels it gets. A rectangle from -10° to 30° east and 36° to 62° north, drawn in the projected plane with the tile boundaries over it. A renderer that draws each tile from the geometry inside that tile puts the label at the centroid of the piece, marked hollow; the whole feature's centroid is the filled mark. The furthest piece's label is 1863 kilometres from it. The pieces' areas sum to the whole to 2.2e-16 of a relative part, so the clipping is exact and the displacement is the operation rather than an error in it. What a machine does with it

A tile is drawn without its neighbours

Independence is what makes the scheme scale: one request touches one square of the world. It also means a feature crossing nine tiles is nine features, each labelled at its own centroid — up to 1,863 kilometres from the whole one — and the displacement is bounded by the size of the feature rather than the size of a tile, so it grows as the reader zooms out.

A 20° shape across the antimeridian, in the space where the numbers live. Longitude runs across the page from −180° to 180°, which is where the failure is: the shape is one rectangle on the ground and two pieces in the numbering, and every operation that treats longitude as a real number sees the two. The bounding box comes out 359° wide instead of 20°, the planar area comes out 17 times too large because the shoelace encloses the complement, and the midpoint of a segment from one edge to the other lands 20015 kilometres away — the antipode of where it belongs. The true area, from the closed form, is 4,920,667 square kilometres. What a machine does with it

The antimeridian is a cut in the numbers

A twenty-degree box across 180° has a bounding box of 359.4°, a planar area seventeen times too large, and a midpoint 20,015 kilometres from where it belongs — which is the antipode, exactly. Moving the cut moves the failure and never removes it, because a circle cannot be numbered by an interval.

The scale asked for and the scale the pyramid has, at 0°. A tiling scheme exists only at integer zoom levels, a factor of two apart in resolution, so a request for any scale between them is answered by the nearest rung. The ratio runs from 0.707 to 1.405 — 1/√2 to √2 — and repeats identically at every doubling, which is four times that in area. A request for 1:10,000 is served at zoom 16, which is 1:8,531; A request for 1:25,000 is served at zoom 14, which is 1:34,124; A request for 1:50,000 is served at zoom 13, which is 1:68,247. Nothing anywhere reports it, because the map that arrives is a perfectly good map of something. What a machine does with it

Zoom is a ladder

A tiling scheme exists only at integer zoom levels a factor of two apart, so a request for 1:25,000 is answered with 1:34,124 — 36 per cent coarser, and 86 per cent coarser in area. The mismatch runs from 1/√2 to √2 and repeats identically at every doubling, and nothing anywhere reports it, because the map that arrives is a perfectly good map of something.

The same address length, a tenth of the area. Every cell of a lon/lat quadtree at level 4 carries an identifier of the same length. The heavy curve is each cell's area as a fraction of the largest, against its latitude: a polar cell is 10.2 times smaller than an equatorial one. The light curve is the inverse of the cell's aspect ratio, which falls from 1.00 near the equator to 0.10 at the top — the cells stop being anything like square long before they stop being usable. What a machine does with it

An address is an area

A cell identifier does not name a place, it names a region — so its precision is an area rather than a length. On the obvious lon/lat scheme that area varies by a factor of 10 at level 4 and 163 at level 8, and the factor doubles with every level: the same identifier length means less ground the further north it is used.

Hilbert order on one face, as a curve. The order in which Hilbert numbering visits the 64 cells of one cube face at level 3. The line never leaves a cell without entering one that shares an edge with it — that is what makes it a space-filling curve, and it is why two cells with nearby identifiers are usually near each other on the ground. What a machine does with it

The address is a curve through the sphere

A database does not fetch a set of cells, it reads ranges of identifiers — so the cost of a query is how many runs its cells form, not how many cells it needs. Hilbert order wins that measurement and loses the one usually quoted for it: its neighbouring cells are further apart in identifier than row-major's, on average and at worst.

Equal bands of screen, unequal bands of ground. A section through a camera pitched 60° from straight down, at the height that makes an untilted view exactly the flat map — 1152 pixels above the plane for a 768-pixel screen and a 36.87° field of view. The rays are drawn at equal spacings up the screen and the blocks below them are the ground each of those equal bands covers: 1.75 plane units per pixel at the bottom of the frame and 16.88 at the top, a factor of 9.7. Nothing about this is a projection of the sphere; it is a photograph of a map, and the map underneath it is still Web Mercator. What a machine does with it

A tilted view has no zoom level

Every essay about the screen so far assumes the map lies flat on it, which was true until about 2015. Pitch the camera sixty degrees and one frame asks for 3.6 zoom levels at once, a square tile covers ground four and a half times deeper than it is wide, and the pyramid has one integer per tile to answer with.

One unit of a vector tile, in metres of ground. A vector tile's coordinates are integers on a lattice 4096 units across the tile, and the tile halves at every level, so one unit is a distance that halves too: 5.48 m at z10 and 0.086 m at z16, at 55°. It is also a different distance at every latitude, by cos φ, because the tile is in Web Mercator — the same factor that makes a grid metre a different quantity of ground at every latitude, arriving in the file format rather than in the projection. What a machine does with it

A vector tile has an integer grid

Six essays on this ladder treat a vector tile as the thing a raster tile is not: geometry, resolution-free, styled at draw time. Its coordinates are integers on a lattice 4,096 units across a tile, the tile halves at every level, and at 55° north one unit is 88 metres at zoom 6 and 21 millimetres at zoom 18.

The whole library