A vector tile has an integer grid
A vector tile is chosen over a raster one for a reason everybody can state: the geometry survives. A raster tile is a picture, fixed at the resolution it was rendered at, and its pixel is a place with a size. A vector tile carries the lines themselves, so the client can restyle them, label them, query them, and draw them at whatever resolution the display has — which is why a screen map is a pyramid of tiles that a vector format was supposed to free from resolution.
The lines it carries are integers. The convention every implementation follows puts a tile’s own extent at 4,096 units across, so a coordinate inside a tile is a whole number between 0 and 4,096 — and the tile is a different size at every zoom level and a different amount of ground at every latitude, because the scale of a screen map is not one number.
The arithmetic of a unit
A tile at zoom z spans 2πR / 2^z of the Web Mercator plane — 9,784 m at zoom 12 — and the extent divides that into 4,096. So one lattice unit is
2πR / (2^z · extent)
of map, and multiplying by cos φ gives ground. There is nothing surprising in the formula and every number in it is a convention: 4,096 is a convention, 256 pixels per tile is a convention, and the doubling is a convention. What is not a convention is that the result is a distance, and that the geometry is snapped to it.
Two consequences follow immediately and neither is usually stated when a vector tile is described as resolution-free.
The first is that the same geometry is a different geometry at every level. Zoom 12’s lattice and zoom 13’s are different lattices; a vertex lands on a different ground point in each; and the two tiles’ versions of one feature are not the same shape.
The second is that below some level a feature has no width. Not a small width — none, because both of its sides quantise into the same lattice column.
What the shape does across the pyramid
The area wandering both ways is the same finding the generalisation ladder reached about a simplification tolerance, arriving from the encoding side. A quantisation moves each vertex to the nearest lattice point, which is a displacement of up to half a unit in each direction with no preferred sign, so the enclosed area is perturbed by a quantity that is as likely to be positive as negative. There is no correction.
The vertex merging is the sharper effect. Forty of sixty-four vertices gone is not a loss of precision, it is a change of object: the ring has become a twenty-four-sided polygon with several zero-length edges in it, and a zero-length edge is a degenerate segment that some geometry code handles and some does not, and it breaks the containment test before it breaks anything visible.
The latitude dependence in that table is the one nobody plans for. A two-metre feature survives to zoom 12 at the equator, zoom 11 at 55° and zoom 10 at 75°: the lattice is finer on the ground at high latitude, so features survive to coarser levels there. A rule of thumb for “the zoom at which this class of feature disappears” is therefore a rule of thumb that is wrong by one or two levels depending on where the feature is.
Two resolutions, and only one of them is the point
The confusion this rung exists to clear up is between two different resolutions a tile carries, which are easy to conflate because both are measured in ground metres.
The level of detail is a modelling decision: which features appear at which zoom, and how much they are generalised. It is documented, it is configurable, it is what a cartographer works on, and it is the thing the tile scheme exists to manage.
The lattice is not a decision at all in the same sense. It is a property of the container, applied after every other decision, and it is the same 1/4,096 of a tile whether the tile carries a country outline or a kerb line. It is chosen once, for the format, on an argument about display pixels.
For most levels the second is far finer than the first and can be ignored: at zoom 14 the lattice is 34 cm at 55° and no generalisation tolerance is anywhere near that. At the coarse end they cross over. At zoom 6 the lattice is 88 m, which is a serious quantity of ground and is comparable to the tolerances used there — so at the levels where the geometry has been most reduced, the container is also doing some of the reducing, and the two are not distinguishable in the output.
The seam, which is not about the lattice
The obvious worry about tiling is that neighbouring tiles will not agree at their shared edge. For the lattice itself that worry is unfounded: tile boundaries are at multiples of the tile size and the extent divides evenly, so the lattices of adjacent tiles at the same zoom are aligned and a vertex on the boundary encodes identically in both.
The disagreement is elsewhere, and it is the generalisation.
A tile is produced from the data that falls in it. The generalisation therefore runs on a piece of the line, with the piece’s own endpoints pinned at the tile boundary, and Douglas–Peucker’s recursion splits at the vertex furthest from the chord between whatever endpoints it was given. Different endpoints, different split, different survivors — which is the same non-commutation the generalisation ladder measured, applied to a cut rather than to a projection — and the two tiles’ answers do not join into the line that would have been produced by generalising the whole.
The effect is not a discontinuity at the seam. Both tiles honour the shared vertex, so the drawn line is continuous. What differs is the interior of each piece, by a distance comparable to the tolerance, so a feature that spans a tile boundary is drawn slightly differently from the way it would have been if the boundary had fallen elsewhere — and it will fall elsewhere at the next zoom level.
This is the tile-boundary problem rung four of this ladder identified for labels and symbols, appearing in the geometry itself. There the fix is a buffer; here a buffer does not help, because the trouble is not that the tile lacks data outside itself but that it decided what to keep without it.
What was computed, and how
The quantisation is done in the Web Mercator plane in metres, rounding to multiples of the lattice step measured from the world origin — which is what a tile-local integer amounts to once the tile’s own offset is added back — and decoded through the inverse Mercator to get the ground position.
That decoding is where the one bug in this rung’s machinery lived, and it is worth stating because it produced entirely plausible output. The northing was computed by taking the Mercator formula’s result and multiplying by the Earth’s radius a second time; the decoding divided by it again, so a round trip was exact and the quantisation in between happened at a step 6.4 million times too fine. The result was a ladder in which the lattice halved correctly, the ground distances were right, and no vertex ever merged with another. Every number was defensible and the effect the essay is about had been scaled out of existence.
The check that caught it is the one the essay’s third figure now runs as an assertion: at a lattice step of 88 metres, a ring 300 metres across must lose vertices. An arithmetic that says otherwise is wrong about something, and the failure was invisible until a quantity was predicted before it was measured.
What a client can do about it
A reader who has to consume vector tiles rather than produce them has three options and they are worth ranking.
Read at the finest level available. The lattice halves with zoom, so a geometry pulled from zoom 16 is quantised sixty-four times more finely than the same feature at zoom 10. If a measurement is being made from tile data, the level it is made at is part of the measurement, and the finest level is the least wrong one. It is also the most tiles.
Do not measure from tiles at all. Areas, lengths and containment tests belong to the source geometry, and a well-built service publishes that separately for exactly this reason. The tile pyramid is a rendering artefact and treating it as a data product is the underlying mistake that all of this is a symptom of.
And where a measurement must come from tiles, report the level with it. A length from zoom 12 and a length from zoom 14 are different numbers about the same feature, and stating which one produced the figure is the same discipline a ruler measurement needs — a quantity with no limit as the resolution improves is not a property of the object.
The corresponding instruction for a producer is shorter: the extent is configurable, and a tile carrying geometry that will be measured rather than only drawn should raise it. Doubling the extent to 8,192 costs one bit per coordinate and halves every quantisation effect in this essay.
Raising the extent buys a zoom level, and costs a bit
The producer’s instruction at the end of the last section — raise the extent — is worth stating as the equivalence it is, because the two things it trades against each other are usually thought of as unrelated.
The lattice step is 2πR / (2^z · extent), so z and log₂(extent) enter it identically. Doubling the extent from 4,096 to 8,192 gives exactly the lattice of the next zoom level down, at every latitude, to the last bit.
The costs are not remotely the same. Serving one level deeper means four times the tiles, four times the requests and four times the storage across the pyramid. Doubling the extent means one more bit per coordinate — under ten per cent on a varint-encoded delta, since the deltas between successive vertices are small and gain one bit only when they cross a byte boundary. The same lattice, for a tenth of the cost, and the reason nobody does it is that the extent is a default in a specification and the zoom level is a knob a service operator turns.
The arithmetic behind the default is worth checking while it is in hand. Four thousand and ninety-six units across a 256-pixel tile is sixteen units per pixel, so a vertex is placed to a sixteenth of a pixel rather than the quarter usually quoted — a comfortable margin, and one that narrows on modern displays: at a device pixel ratio of two the tile is drawn across 512 physical pixels and the margin is an eighth, and at three it is a twelfth.
That still leaves the lattice far below what a display resolves, which is exactly the specification’s argument and exactly its limit. The margin is generous for drawing and irrelevant to measuring, and the sixteenth of a pixel says nothing about the 88 metres of ground the same lattice is worth at zoom 6. A resolution argued in pixels answers a question about pictures, and the essay’s whole subject is the questions that are not about pictures.
Where the model stops
One extent and one projection. Four thousand and ninety-six units is the near-universal convention and Web Mercator is the near-universal projection, and both are inputs here. A tile scheme in another projection has the same lattice and a different latitude dependence — an equal-area tiling’s units would be constant on the ground and variable on the page, which is the trade the other way round.
Nothing here measures what it buys. The whole point of a coarse lattice is that small integers compress well, and the byte saving from quantising at 4,096 rather than storing doubles is the reason the format is usable at all, in the same way that the square world costs the poles and buys everything else. That saving is real and large and is not weighed against these costs anywhere in this essay.
Nothing is said about attributes. A tile carries feature properties as well as geometry, and those are quantised too — numbers are stored to a stated precision, and a value that varies below it becomes a constant. That is the same failure in a different column and it is not measured here.
And the merging measured is of one ring. How many vertices merge depends on the vertex spacing relative to the lattice step, which is a property of the data. What is general is the threshold — a feature narrower than one unit has no width — and that is arithmetic rather than an experiment.
The generalisation
A format’s storage decision is a modelling decision, and it is made after every modelling decision anybody documented. The projection was chosen, the generalisation tolerance was chosen, the level of detail was chosen — and then the encoder quantised, at a resolution nobody in that chain selected, because it is a property of the container.
The pattern is the one every fixed-point representation produces. An audio file’s bit depth is a floor on what can be represented and it is chosen for file size; a colour image’s eight bits per channel is why banding exists in gradients that were smooth in the source. In each case the quantity that suffers is not the one the format’s description talks about.
What the tile case adds is the interaction with the pyramid. An audio file has one bit depth. A tile pyramid has a different lattice at every level, so the same feature is represented at a dozen different resolutions and none of them is the source. Anything read back from a tile — an area, a length, a containment test — is read from whichever level the client happened to have loaded, and the answer depends on the zoom the user was at.
Who found it, and when
The vector tile specification that made the convention universal is Mapbox’s, first published in 2014, and it fixes the extent at 4,096 by default while allowing others. The choice is well reasoned in the specification itself: 4,096 is 2¹², so twelve bits per coordinate, and it is four times a 256-pixel tile’s resolution, so a vertex can be positioned to a quarter of a pixel — which is below what a display can resolve and is therefore, at the zoom the tile is drawn at, invisible.
That reasoning is correct and complete for the purpose it states. The gap is that the tile is not only drawn at the zoom it was built for. It is drawn when over-zoomed, which this ladder has already measured; it is queried; and its geometry is read back by software that has no idea what lattice it came off.
The zero-width feature is old news in raster cartography, where it is called the minimum-drawable-dimension and has been in specifications since the nineteenth century — a stream narrower than the pen that draws it becomes a single line by convention, and the convention is documented. The vector-tile version happens silently in an encoder.
Where the ladder goes next
This rung is about a resolution the format imposes. The cells ladder next door has a debt of a different kind: it measured what moving a field between two grids costs, using two schemes whose cells are rectangles in the same coordinate — which is what made every overlap a rectangle, and which is not true of any of the schemes anybody actually argues about.
Named alongside this one
Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.
- A tilted view has no zoom level ground resolution · quantisation · tile pyramid · web mercator
- A coordinate is a number with a width ground resolution · precision · quantisation
- A boundary that two features share generalisation · topology
- A grid reference names a square precision · quantisation
- A tolerance in map units is not a tolerance generalisation · web mercator
- An address is an area precision · tile pyramid
What links here
Every essay whose body links to this one.
The objects this essay names
Each one links to every other essay that touches it.
GeneralisationGround resolutionLatticePrecisionQuantisationResolutionSeamTile pyramidTopologyVector tileWeb MercatorZoom