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.

The property that makes a tile scheme work is that a request touches one square of the world. Nothing about the tile at 12/2047/136212/2047/1362 depends on the tile beside it, so tiles can be rendered in any order, on any machine, and cached forever.

That independence is also the scheme’s structural limit, and unlike most limits in this field it is not about the projection at all.

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.
Fig. 1 A rectangle spanning Europe, clipped to the nine tiles it crosses at zoom 4. The pieces are exact — their areas sum to the whole to a relative 2×10⁻¹⁶, which is the control — and their centroids, marked hollow, are up to 1,863 kilometres from the whole feature’s, marked filled. A renderer that labels each piece produces nine labels and none of them in the right place.

The measurement, and its control

Clipping a polygon to a rectangle is Sutherland–Hodgman, which is exact arithmetic on the vertices, and the first thing to establish is that the clipping itself is not introducing anything.

The pieces’ areas sum to the whole polygon’s to a relative 2×10162\times10^{-16} — one bit of a double. That is asserted before anything else is measured, because a clipper with a subtle error would produce displacement figures that were partly its own, and the whole argument would be about the implementation rather than about the scheme.

With that established, the centroid of each piece is a fact about the decomposition. For the European rectangle at zoom 4: nine pieces, and the furthest piece’s centroid is 1,863 kilometres from the whole feature’s.

The displacement is bounded by the feature, not by the tile

The obvious guess is that a tiling artefact is bounded by the tile size, which would make it shrink as the reader zooms in. It does the opposite, and the numbers say so plainly:

zoom tile pieces worst displacement
2 10,019 km 2 1,053 km
3 5,009 km 4 1,798 km
4 2,505 km 9 1,863 km
5 1,252 km 20 1,863 km
6 626 km 72 2,212 km

The displacement does not fall with the tile size; it saturates at roughly half the feature’s own extent, because the furthest a piece’s centre can be from the whole’s is set by how far apart the two ends of the feature are. What does change with zoom is the number of pieces — two, four, nine, twenty, seventy-two — so the effect goes from a duplicated label to a scattered mist of them.

In screen units it grows without limit: 27 pixels at zoom 2, 190 at zoom 4, 904 at zoom 6. That is the number a reader sees, and it is why the artefact is a zoomed-out phenomenon: a country whose label appears twice, in two places, neither of them the country’s middle.

A city-sized feature behaves the same way at its own scale. A box across London gives nine pieces at zoom 10 with a worst displacement of 28.6 kilometres, eighty pieces at zoom 12, and 1,147 at zoom 14 — the same saturation, at the size of the feature rather than at the size of the tile.

A feature across 80 tiles at zoom 12, and the 80 labels it gets. A rectangle from -0.5° to 0.3° east and 51.3° to 51.7° 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 34 kilometres from it. The pieces' areas sum to the whole to 4.8e-15 of a relative part, so the clipping is exact and the displacement is the operation rather than an error in it.
Fig. 2 The same measurement on a feature two orders of magnitude smaller. Eighty pieces, and the worst label displacement is 33.5 kilometres — again about half the feature’s own extent, at a zoom where a tile is 9.8 kilometres across. The scale of the artefact follows the feature and ignores the grid.

What has to cross the boundary anyway

A tile cannot be rendered from strictly its own geometry, because ink is wider than a line.

A stroke of width ww reaches w/2w/2 either side of the feature, so a road crossing a tile edge is drawn to the edge and no further, and the neighbouring tile does the same: a hairline gap at every crossing. A mitred join at a vertex just outside reaches further still, by w2csc(θ/2)\frac{w}{2}\csc(\theta/2) — for a four-pixel stroke at a 30° join, 7.7 pixels.

Labels are worse. A place name 120 pixels wide, centred on a point ten pixels outside the tile, must be drawn by a tile that does not contain the point at all, so the geometry a renderer needs extends at least half a label beyond the edge: 60 pixels, or 23 per cent of a 256-pixel tile.

In ground units that buffer is 22.8 kilometres at zoom 8, 1,428 metres at zoom 12, and 89 metres at zoom 16 — the same fraction of a tile at every level, which is the useful way to hold it. The scheme’s independence is therefore not quite independence: each tile is rendered from a neighbourhood of itself, and the neighbourhood’s width is a rendering decision measured in pixels rather than a geographic one measured in metres.

Metres per pixel, published and on the ground, zoom 4 to 16. The scheme's own resolution, and what a pixel is worth on the ground at two latitudes. Every level is exactly half the one above, so the published line is straight on a logarithmic axis and any two levels differ by a power of two. The ground curves are the same line lowered by log cos φ: at 51.5° a pixel covers 1.6 times less ground than the table says, so a reader there is looking at a map 1.6 times larger in scale than the one asked for.
Fig. 3 The buffer’s ground width, level by level. It is a fixed share of a tile — 23 per cent for a label — so in metres it follows this curve exactly: 22.8 kilometres at zoom 8 and 89 metres at zoom 16, at the latitude the lower line is drawn for.

Which operations survive being cut up

The general question behind all of this is worth stating in one line, because it decides what a tiled renderer can and cannot do: an operation can be tiled exactly when it commutes with restriction.

Operations that do commute — the whole of what a tile scheme is good at:

  • filling a polygon, since the fill of a piece is the piece of the fill;
  • stroking a line, given the buffer above;
  • drawing a point marker, given a buffer of the marker’s own radius;
  • colouring by an attribute, since an attribute is carried by the feature and survives clipping.

Operations that do not, and every one of them is a place where a tiled map visibly misbehaves:

  • placing a label, which needs the whole feature, as measured above;
  • deciding which labels to drop, which needs to know what else is on the screen — and the screen spans several tiles;
  • simplifying geometry, since simplifying the pieces of a line and joining them is not the same line as simplifying the whole;
  • computing anything about the feature — its area, its length, its centroid — which is the subject of the next half of this field and which is exactly the failure the hero figure measures.

That list is not a criticism. It is a specification: the operations in the second group have to be done somewhere else, once, over the whole feature, and their results attached to the tiles as data. Which is what every serious renderer does, and which is why a vector tile carries a label point as an attribute rather than expecting the renderer to find one.

The buffer has a price, and it is paid in bytes

A tile rendered from a neighbourhood of itself carries geometry it will not draw, and the overhead is computable from the buffer fraction alone.

A buffer of bb tile-widths on each side means each tile holds the content of a square (1+2b)(1 + 2b) across. At the 23 per cent computed above that is 1.4692=2.161.469^2 = 2.16 tiles’ worth of geometry — 116 per cent overhead in the limit where features are small compared to a tile, since each one is carried by every tile whose buffered square contains it.

The real figure is lower, because a large feature is clipped and its interior is carried once, and higher for dense point data, where every point near an edge appears in two, three or four tiles. Either way the buffer is not a rounding on the data volume; it is a factor.

That is the trade in its plainest form. Independence is bought with duplication: the scheme stores each edge region several times so that no renderer ever has to ask about a neighbour. Compare the survey world’s version in where two zones meet, where the same problem is solved the same way — an overlap belt in which points carry two coordinates — for the same reason and at the same kind of cost.

The tile pyramid, four levels down to quadkey 031. 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 40° north is 14989.9 metres of ground per pixel rather than the number the scheme publishes.
Fig. 4 Why the overhead is a fraction rather than a quantity. The buffer is specified in pixels — half a label, a mitred join — so it is the same share of every tile at every level, and the geometry duplicated at zoom 4 is duplicated again, independently, at zoom 5. A pyramid of nineteen levels stores its edge regions nineteen times over.

The decomposition that fixed the labels

The label problem has a solution and it is not a better tiling. It is to stop rendering in tiles.

A scheme that ships geometry rather than pictures — coordinates in a tile-local system, drawn by the reader’s own machine — has a viewport rather than a tile as its unit of rendering. Labels are then placed once over everything in view, collisions are resolved globally, and the two symptoms above disappear: no duplicate names, and no label that moves because a different tile won the argument.

What that does not fix is the geometry: the features still arrive clipped, so a feature’s centroid, area and length are still unavailable to the renderer, and still have to be computed once, elsewhere, over the whole thing and attached as an attribute. The distinction between the two halves is exactly the one made above — placing a label is a presentation operation and can be moved to the viewport, while computing a centroid is a measurement and cannot be done from pieces at all.

Which is the sentence this half of the field hands to the other half. Everything from here on is about measurements made on stored geometry, and the first thing to establish is that a measurement needs to know what it is measuring on — as computing an area needs a surface sets out, and as a coordinate without its system is not a location establishes before it.

The seam is a general shape

A tile boundary is a seam in the picture, and this site has met several.

Where two zones meet is the survey version: two grids covering the same ground, a belt of overlap, and a point that carries two coordinates. Giving up continuity is the projection version: an interrupted map places its tears where the distortion would otherwise be worst, and the size of the tear is measured rather than hidden. The antimeridian is a cut in the numbers is the numbering version, and the one place in this field where the seam cannot be moved away, only moved.

The tile seam is the mildest of the four and the only one that is chosen for convenience with no geometric content whatever. A zone boundary is where a projection’s error would grow too large; an interruption is where an ocean can absorb a tear; the antimeridian is forced by the topology of a circle. A tile edge is at a power of two.

That is why it is the only seam in the list that is invisible when handled correctly, and the only one whose handling is purely a matter of engineering: buffer the geometry, compute the global operations globally, and nothing shows.

Both zones are right, and one of each is not. A 20 km baseline straddling the boundary between UTM zones 31 and 32 at 52°N, computed from grid coordinates three ways, on logarithmic bars. Taking both ends in zone 31 and taking both in zone 32 give answers 0 nanometres apart — the resolution a double has left after carrying a six-figure easting rather than a disagreement — so a job may use either and the overlap belt every zone publishes exists to let it. Taking each end from the zone it nominally belongs to gives 392 km, because the two eastings are measured from meridians six degrees apart and subtracting them measures nothing at all. The same ground point is 706 km east in one zone and 294 km east in the other, and both coordinates are correct.
Fig. 5 The survey world’s version of the same problem: a belt where two zones overlap, a point with two sets of coordinates, and a measurable cost to crossing. The difference is that this seam is placed where the projection’s error demands it, and a tile’s is placed at a power of two.

How much of the map is affected, which is a probability

A feature is only affected if it crosses an edge, and how often that happens is arithmetic rather than a matter of luck. For a feature of extent LL on a tile of width TT, with the grid’s origin unrelated to the feature, the chance of crossing at least one edge in one direction is L/TL/T, so in two it is

p=1(1LT)2(L<T)p = 1 - \left(1 - \tfrac{L}{T}\right)^2 \qquad (L < T)

and one for anything larger than a tile. That gives:

feature zoom 8 · 156.5 km zoom 12 · 9.78 km zoom 16 · 611 m
100 m 0.1% 2.0% 29%
1 km 1.3% 19% 100%
10 km 12% 100% 100%

The pattern is that the deeper the zoom, the larger the share of features that are cut — which is the opposite of the intuition that zooming in shows things more faithfully, and it is the same inversion as the displacement table above.

What saves the appearance is the other half of the arithmetic: the same zoom that cuts everything also makes every feature large on the screen, so the pieces are big and the label placement has room. The two effects run in opposite directions and roughly cancel, which is why a well-built map looks correct at every level and why the failures cluster at the zooms where features are small on screen and comparable to a tile — which is a narrow band, and is exactly where duplicated country labels live.

One pixel at zoom 12: 38.2 m projected, 25.9 m at 47.3°. 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 5.2 metres, against a worst case of 18.3 — half a pixel's diagonal, which is the whole of the bound. The second point sits 4377 metres away, 145.64 of a pixel east and 85.92 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 0 per cent of the possible offsets, against the 0 per cent the two fractions predict.
Fig. 6 The other quantisation in the same picture, at the zoom where features and tiles are most nearly the same size. Both effects are grid-relative — whether a vertex rounds up or down, and whether a feature crosses an edge — and both depend on where a grid nobody chose happens to fall relative to ground nobody placed.

The piece count is a law, and it is the one that grows

The displacement saturates and the piece count does not, so the piece count is the quantity that decides how bad a zoom level looks — and it has a closed form that the measured tables obey to within a piece.

A feature of extent L laid on a grid of pitch T, with the grid’s origin unrelated to the feature, spans on average 1 + L/T tiles in one direction, so

expected pieces=(1+LxT)(1+LyT).\text{expected pieces} = \left(1 + \frac{L_x}{T}\right)\left(1 + \frac{L_y}{T}\right).

Against the European rectangle’s measured counts of 2, 4, 9, 20 and 72 at zooms 2 to 6, the expression gives 2.0, 4.0, 8.9, 20.1 and 73 — with the vertical extent taken in Mercator’s own northing rather than in degrees of latitude, which is where a first attempt goes wrong. On the London box at zoom 14 it gives 1,126 against a measured 1,147.

Five orders of magnitude, one expression, no fitting.

And the law says the count quadruples for every level once the feature is larger than a tile, because both factors are then dominated by L/T and T halves. That is the growth the displacement table does not show: at zoom 4 a European feature is nine labels in the wrong place and at zoom 8 it would be over two thousand, each of them still up to 1,863 kilometres from the feature’s middle.

Which sharpens the essay’s own observation about where the failures live. The displacement is worst when a feature is comparable to a tile, and the count is worst when it is far larger — so a country label at zoom 4 is a handful of badly placed names and the same country at zoom 10 is a mist of them. The reason nobody sees the second is not that the arithmetic stops; it is that no renderer labels clipped pieces at those levels, having attached a label point as an attribute exactly as this essay recommends.

The law also prices the buffer’s duplication more precisely than the 116 per cent figure. A buffer of b tile-widths adds 2b to each factor, so the ratio of buffered to unbuffered content is ((1 + L/T + 2b)/(1 + L/T))², which tends to one for a large feature and to (1 + 2b)² for a small one. The overhead is therefore a property of the feature size relative to the tile, and the 116 per cent quoted is the small-feature limit — correct for point data and a considerable over-estimate for coastlines.

What a reader actually sees

Three symptoms, and they are recognisable once named.

A duplicated label — the same name appearing twice on one screen, on either side of an invisible line. That is the centroid failure with two pieces.

A label that moves when the map is panned. Panning does not change the tiles, but it changes which of them are in view and which label a renderer chooses to keep when two collide; the label placement problem is not tileable, so its answer depends on the viewport.

A hairline crack in a coastline or a road at a particular zoom, which is the buffer being too small for the stroke width the style asks for — and which appears at one zoom and not another because the stroke is in pixels and the buffer was computed in metres.

All three are absent from most maps most of the time, which is a genuine engineering achievement and worth saying. The scheme’s independence is real; what is not real is the idea that it is free.

The trade, stated in the field’s own terms

The scheme buys delivery — one lookup for any part of the world at any scale, cacheable forever, renderable in parallel — and pays in globality: every operation that needs to see a whole feature has to be moved out of the renderer.

That is the same shape as every other trade in this collection. Every projection minimises something and this scheme minimises the cost of serving a picture; what it gives up is not a metric property but a structural one, and the structural loss has a size — 1,863 kilometres for a European feature at zoom 4, 23 per cent of a tile for a label’s buffer, and a piece count that reaches 1,147 for a city at zoom 14.

Naming a cost and measuring it are different, and the second is what the site is for.

One last reading of the law is worth carrying, because it says which of the two quantities a renderer should be tuned against. The displacement saturates and the count does not, so a scheme that is judged by how far wrong a label is looks equally bad at every zoom, and one judged by how many wrong labels there are looks worse at every level. Only the second matches what a reader complains about.

Where this ladder goes next

The last rung of this ladder asks the question the whole screen half has been circling: the pyramid needed a square world and a projection, and Mercator was not the only one available. The equal-area cylindrical whose world is exactly square has standard parallels at ±55.654°, and what choosing it would have cost is measurable in the same units as what choosing Mercator did.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.

What links here

The 8 essays that link to this one and share the most of its objects, of 12 that link here.

The objects this essay names

Each one links to every other essay that touches it.

BoundaryCentroidClippingConventionGround resolutionLocalityQuantisationTile pyramidToleranceVerificationZoom level