Generator family

A map on a screen: the pyramid, the pixel, and the tile

tile-pyramid, zoom-ladder and pyramid-tradeoff are the quadtree; resolution-ladder, screen-scale and scale-bar the metres a pixel stands for; pixel-grid and quantisation-grids the grid the pixels make against the grid of degrees; world-cut and square-worlds the choice of a square world; tile-clip the geometry cut at a tile edge; and tilted-view the camera that has no zoom level at all.

tile-pyramid, zoom-ladder and pyramid-tradeoff are the quadtree; resolution-ladder, screen-scale and scale-bar the metres a pixel stands for; pixel-grid and quantisation-grids the grid the pixels make against the grid of degrees; world-cut and square-worlds the choice of a square world; tile-clip the geometry cut at a tile edge; and tilted-view the camera that has no zoom level at all.

Every one of these is the same generator answering a different question, which is why they share a file, a set of colour roles and a set of assertions. Changing it changes all 12.

17 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.

What it draws

One picture per question the family answers. Each has a page of its own.

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.

A 1,000 km bar on Mercator, drawn at 0° and read elsewhere. The same length of paper, carried up the map. Each pair of bars is the ground distance that length actually spans at that latitude — the filled bar along the parallel, the outline along the meridian. At 75° the reading along the parallel is 259 km against the 1,000 the bar claims, an error of 74 per cent. The two readings agree everywhere, because Mercator is conformal — so one number per latitude corrects any measurement taken off it. What a machine does with it

A scale bar is right in one place

The bar in the corner of a world map is a picture of a distance, and it is a true picture along one line. On Mercator it reads 500 kilometres for a thousand at 60° north — and on an equal-area map it reads 500 one way and 2,000 the other, so the projection recommended for measuring is the one on which no single correction exists.

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.

One pixel at zoom 11: 76.4 m projected, 47.6 m at 51.5°. The grid squares are pixels, at their own size. The open mark is the stored coordinate and the filled one is where it is drawn: rounding moves it 20.2 metres, against a worst case of 33.6 — half a pixel's diagonal, which is the whole of the bound. The second point sits 43 metres away, 0.58 of a pixel east and 0.70 north, so whether the two are drawn as one dot or two is decided by where the tile grid happens to fall: they merge for 12 per cent of the possible offsets, against the 12 per cent the two fractions predict. What a machine does with it

The pixel is a place with a size

Drawing a coordinate rounds it to a pixel, which moves it by up to half a diagonal — 16.8 metres at zoom 12. Whether two points 43 metres apart appear as two dots is not a property of the data at all: they merge for 12 per cent of the positions the tile grid could take, and the closed form predicts 12.4.

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.

Two square worlds: Mercator's areas against an equal-area scheme's angles. Both projections give a world exactly as wide as it is tall, so either could carry a quadtree of square tiles. Mercator keeps every angle and inflates area by sec²φ — 132-fold at 85°. The cylindrical equal-area scheme whose world is square has standard parallels at ±55.65° — the solution of π cos²φ₀ = 1 — and keeps every area exactly, at a cost of nothing there and 145° of angular deformation at the edges. At the standard parallel itself Mercator's areal factor is 3.142, which is π, because the square-world condition and sec²φ are the same equation. What a machine does with it

The pyramid did not have to be Mercator

The usual defence is that a quadtree needs a square world and Mercator supplies one. So does the cylindrical equal-area with standard parallels at ±55.654° — the solution of π cos²φ₀ = 1 — and it needs no polar cut at all. What Mercator actually buys is conformality, and the price of giving it up is 13.8° of shear at 60° north.

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 whole library