What a machine does with it

Simplification does not commute with the projection

A pipeline either simplifies the geometry and then projects it, or projects it and then simplifies. Both orders are in use, neither is recorded, and given the same tolerance in ground metres they keep different vertices — 129 of them on the ground, 367 in degree space at 80°, and 459 on an equal-area page.

A line has a length only at a scale, and the scale a map is drawn at is a decision made long before the page. A geometry is generalised somewhere. It has to be: nothing on a page can carry the vertices a survey produced, and no screen can draw them. The question this essay is about is not whether the reduction happens but where in the sequence it happens, and the answer is that nobody writes it down.

There are two places, and both are in daily use. A pipeline can simplify the source geometry — in whatever coordinates it arrived in, which for most exchanged data is degrees of latitude and longitude — and then project the survivors. Or it can project everything and simplify on the page, in the map’s own units, which is what a renderer does because the page is where the tolerance is meaningful. The two orders are given the same instruction and they do not do the same thing.

The same tolerance, applied in two orders, at 65°. The faint line is the region's boundary as built, 1025 vertices across 400 km of ground. Both pipelines were given the same tolerance of 2000 m on the ground. Simplifying in degrees and then projecting keeps 311 of them; projecting into Mercator and then simplifying keeps 129; doing it on the ground itself, which no pipeline does, keeps 129. The two drawn lines separate by 1883 m, which is 94 per cent of the tolerance that was supposed to bound the whole operation.
Fig. 1 One region’s boundary, 1,025 vertices across 400 km of ground, and two pipelines given the same tolerance of 2,000 m. Simplifying in degrees and then projecting keeps 311 of them; projecting into Mercator and then simplifying keeps 129; doing it on the ground itself, which no pipeline does, also keeps 129. The two drawn lines separate by 1,883 m — 94 per cent of the tolerance that was supposed to bound the whole operation.

The tolerance has to be a ground distance before anything can be compared

Comparing two orders means giving them the same instruction, and the only instruction that means the same thing in both spaces is a distance on the ground. So the experiment is set up that way: ε is metres of ground, and it is converted into each space rather than typed into both.

For the degree-space pipeline, ε becomes a tolerance in degrees, by dividing by the length of a degree of the meridian. That is what “a tolerance in degrees” means in every piece of software that offers one, and it is where the first of the two failures comes from.

For the page-space pipeline, ε is multiplied by the projection’s own point scale factor at the middle of the region. That is more careful than what most pipelines do — a real one types a number of map units and never converts at all — and it is deliberately generous, because the argument is stronger if the page-space route is given its best chance.

The third route is the control: run the same algorithm on the ground coordinates themselves. No pipeline does this, because the geometry is never in ground coordinates; it is the answer both of the others are trying to approximate.

Degree space is stricter east–west, by exactly sec φ

Douglas–Peucker measures the distance from a vertex to the segment standing in for it. In degree space that distance is computed as if a degree of longitude and a degree of latitude were the same length, and they are not: a degree of longitude is R cos φ, so a given east–west ground distance registers as larger in degree space by 1/cos φ.

The algorithm therefore believes east–west departures are bigger than they are, and keeps vertices it was not asked to keep.

Vertices kept, for the same ground tolerance. The ground answer keeps 129 vertices at every latitude, because the tolerance is a ground distance and the region is the same region. A pipeline that simplifies in degrees keeps more and more of them the further north the region is — 367 at 80°, a factor of 2.84 — because a degree of longitude is a shorter distance up there and the algorithm is comparing degrees. It is not simplifying badly; it is simplifying something else.
Fig. 2 Vertices kept for the same 2,000-metre ground tolerance. The ground answer keeps 129 at every latitude, because the tolerance is a ground distance and the region is the same region. Degree space keeps 129 at 15°, 185 at 45°, 311 at 65° and 367 at 80° — 2.85 times too many. It is not simplifying badly; it is simplifying something else.

The direction of the error is worth pausing on, because the intuition usually runs the other way. A high-latitude region looks stretched in degree space, and the instinct is that an algorithm working there will over-simplify. It under-simplifies: it treats the stretch as real distance, decides the line is wigglier than it is, and keeps the detail. The output is a file that is larger than asked for and a geometry whose east–west detail has survived while its north–south detail has not — an anisotropy in what was kept, produced by an isotropic instruction.

Page space is exact where the page is conformal

The other order fails differently, and the difference is the site’s own subject.

A tolerance on the page is a circle: the algorithm asks whether a vertex is within ε of a line, in the page’s own metric, in every direction equally. The ground that circle stands for is the circle’s preimage, which is Tissot’s indicatrix with the axes inverted. Where the map is conformal that preimage is a circle, so the instruction the algorithm carries out is the instruction it was given. Where the map is not conformal it is an ellipse, and the effective tolerance is a different ground distance in every direction — which is distortion having a direction arriving in a place nobody expects it.

Simplifying on the page is exact where the page is conformal. How far each pipeline's answer sits from the one computed on the ground, in metres, for a tolerance of 2000 m. A tolerance on the page is a circle; the ground it stands for is the indicatrix. Where the map is conformal that circle stays a circle and the answer is the ground answer exactly, until the scale factor's variation across the region catches up. Where it is not, the tolerance is a different distance in every direction and the answer is wrong at every latitude, the equator included.
Fig. 3 How far each pipeline’s answer sits from the one computed on the ground. Projecting first into Mercator gives the ground answer exactly, to zero metres, up to 65°, and departs at 80° only because the scale factor’s variation across a 400-km region has caught up. Projecting first into the Lambert cylindrical equal-area is wrong at every latitude including the equator, because that map’s indicatrix is never a circle away from its standard parallel.

The numbers are unambiguous. On Mercator the page-space route keeps 129, 129, 129 and 135 vertices at 15°, 45°, 65° and 80° — the ground answer, until the region is large enough that one scale factor cannot describe it. On the Lambert cylindrical it keeps 171, 255, 367 and 459: more and more, and wrong at the equator, where its anisotropy is already 1.07 to 1.

Conformality is not a nicety here. It is the precise condition under which a tolerance stated on the page is a tolerance on the ground, and it is the reason a rendering pipeline that generalises in Web Mercator is doing something defensible while one that generalises in an equal-area projection is not — a sentence that inverts the usual ordering of those two maps’ reputations.

The projection on which both orders agree

There is one map in the library on which the two pipelines keep exactly the same vertices, at every latitude, to the vertex.

Vertices kept, for the same ground tolerance. The ground answer keeps 129 vertices at every latitude, because the tolerance is a ground distance and the region is the same region. A pipeline that simplifies in degrees keeps more and more of them the further north the region is — 367 at 80°, a factor of 2.84 — because a degree of longitude is a shorter distance up there and the algorithm is comparing degrees. It is not simplifying badly; it is simplifying something else.
Fig. 4 The plate carrée. Its page coordinates are longitude and latitude with a constant in front, so simplifying on the page and simplifying in degree space are the same computation, and the two orders can never disagree. They agree on an answer that is wrong: 367 vertices at 80° against the ground’s 129.
Angular deformation against latitude, three projections. The same quantity for equirectangular, mercator, lambertCylindrical, from the equator to 80°. A conformal projection sits flat on zero in the first of these plots and runs away in the second; an equal-area projection does the reverse. Nothing is flat in both.
Fig. 5 The three maps this essay separates, compared by their angular deformation against latitude. Mercator is conformal, so a circle on its page is a circle on the ground and a page tolerance is a ground tolerance. The Lambert cylindrical is equal-area and strongly anisotropic there, so it is not. The plate carrée is neither, and is the one whose page coordinates are the degrees themselves.

The plate carrée is degree space. Its forward map is x = λ, y = φ, so a distance measured on its page is a distance measured in degrees, and the two orders are one operation. That is a real property and it is the reason the plate carrée is what pipelines fall back to when nobody chose a projection — but it buys agreement rather than correctness, and this collection has an essay about exactly that habit.

It also makes a useful control. If the two orders disagreed on the plate carrée, the disagreement measured everywhere else would be an artefact of the experiment rather than of the projections.

What was computed, and how

The region is a curve built to have a stated fractal dimension, 400 km across, at depth 5 — 1,024 segments whose finest is 1,296 m, comfortably above the tolerance so that the algorithm has real decisions to make. It is placed on the sphere through the local tangent plane at the anchor point, so a displacement of x metres east is x metres east before any projection appears, and the ground truth is defined before the experiment starts.

Both pipelines return a subset of the original vertices — Douglas–Peucker only ever discards, never invents — so each answer can be traced back to ground coordinates by index and the two can be compared as ground polylines. The separation reported is the symmetric Hausdorff distance between them, in metres of ground.

The same tolerance, applied in two orders, at 45°. The faint line is the region's boundary as built, 1025 vertices across 400 km of ground. Both pipelines were given the same tolerance of 2000 m on the ground. Simplifying in degrees and then projecting keeps 185 of them; projecting into Lambert cylindrical and then simplifying keeps 255; doing it on the ground itself, which no pipeline does, keeps 129. The two drawn lines separate by 1883 m, which is 94 per cent of the tolerance that was supposed to bound the whole operation.
Fig. 6 The same experiment on an equal-area map at 45°, where the page-space route keeps 255 vertices against the ground’s 129. The two lines here are both wrong and wrong in different directions, which is the case a reader of either file has no way to detect: both are plausible generalisations of the same boundary at the same nominal tolerance.

The separation between the two orders reaches 1,883 m against a tolerance of 2,000 — 94 per cent of it. That is not larger than the tolerance, and the essay is not claiming it is. What it is, is additional to the tolerance: each route is within ε of the original in its own reckoning, and the two are nearly another ε apart from each other, so a consumer comparing two vendors’ generalisations of the same feature sees a discrepancy of about twice what either vendor’s specification suggests.

The tolerance nobody converts

The experiment above was generous to the page-space route: ε was converted into map units using the projection’s own scale factor. Real pipelines type a number.

What "10 metres" means when the metres are Web Mercator's. A simplification tolerance is nearly always typed as a number of the projection's own units, because that is what the geometry is in when the algorithm runs. On Web Mercator those units are ground metres on the equator and nowhere else: 10 m of map is 10.00 m of ground at 0°, 5.00 m at 60° and 0.87 m at 85°. The same line in the same file is generalised 11.5 times more finely at the top of the map than at the bottom.
Fig. 7 Ten metres of Web Mercator, in metres of ground, against latitude. It is ten metres on the equator and nowhere else: 8.66 m at 30°, 7.07 m at 45°, 5.00 m at 60°, 2.59 m at 75° and 0.87 m at 85°. The same line in the same configuration file is generalised eleven times more finely at the top of the map than at the bottom, and the file records the number rather than what it meant.

This is the same object as a grid metre not being a ground metre and as the written precision of a coordinate, arriving in a third place. A quantity in the projection’s units is a quantity on the ground only where the scale factor is one, and a generalisation tolerance is a quantity in the projection’s units in almost every pipeline that has one.

The practical shape of it: a dataset generalised for a world map at a single tolerance carries far more detail in high latitudes than in low ones, at a cost in bytes that is invisible in the specification and shows up in the tile sizes.

Which order a reader can detect, and which they cannot

A file of generalised geometry does not say what was done to it. What it does carry is the vertices, and the vertices carry a trace of the order — sometimes.

The degree-space route leaves a signature that is readable: its retained vertices are denser in the east–west direction than in the north–south, by about 1/cos φ, because that is exactly what its metric mistook. Measure the ratio of retained-vertex spacing along the two axes as a function of latitude and the sec φ comes out. It is not proof, since a real boundary can be anisotropic on its own account, but it is evidence, and it is the only evidence there is.

The page-space route on a conformal projection leaves nothing to find, because it did the right thing. The page-space route on a non-conformal projection leaves the projection’s own anisotropy in the retained vertices — which means, awkwardly, that the trace of the mistake looks like the trace of the correct answer computed for a different map.

Tissot's indicatrix across Lambert cylindrical. A small circle on the sphere, drawn where the projection puts it. The dashed circle behind each is what an undistorted map would show. On Lambert cylindrical ω reaches 74°, and the areal factor reaches 1.0.
Fig. 8 The reason a page-space tolerance is not a ground tolerance on an equal-area map. Each ellipse is the image of a circle on the ground; a circle drawn on the page, which is what the algorithm’s tolerance is, has the inverse of that shape as its ground preimage. On the equator the axis ratio is already 1.07, at 60° it is 4, and the tolerance the algorithm believes it is enforcing is that much wrong in the east–west direction.

The practical advice that follows is short and is the reason this rung exists: generalise on the ground, or on a conformal projection of the region, and record which. The first is what the control in these measurements does and it is easy — the coordinates are available, and the tolerance is already in metres. The second is what a renderer does anyway. What no pipeline should do is generalise in degrees, which is what the default in most exchange formats invites.

Where the model stops

One region, one shape. The numbers are for a boundary of one roughness at one size. A smoother boundary has fewer decisions to make and the two orders will agree more often; a rougher one will disagree more. The direction of every effect here is a property of the geometry rather than of the example — degree space is stricter east–west by sec φ whatever the shape is — but the magnitudes are the example’s.

Douglas–Peucker only. Visvalingam’s rule has an area threshold rather than a distance, so “the same tolerance in both spaces” does not even parse for it, and the comparison would need a different setup. What can be said is that its threshold is an area, so it picks up the square of the scale factor rather than the first power, and its two orders will disagree more rather than less.

And the region is small enough for one tangent plane. Four hundred kilometres at 80° is a region across which the meridian scale changes by a few parts in a thousand, so the ground truth is exact to that. A continent-sized feature has no single ground tolerance for the same reason it has no single scale, and the question of what ε even means there is not answered here.

The generalisation

Two operations that are each defined in their own coordinates do not commute unless one of them is an isometry in the other’s metric. That is the whole of it, stated without any cartography, and the cartographic case is the vivid one because the map is exactly the non-isometry.

The pattern recurs wherever a reduction and a transformation are both applied to the same data. Resampling and reprojecting an image is the same question — and the collection has measured that one too. Rounding and unit conversion is the arithmetic version: converting to feet and rounding is not rounding and converting. Filtering and resampling a signal is the version every textbook on the subject opens with.

What cartography adds is that the transformation’s non-isometry is quantified — the scale factor and the angular deformation are tabulated for every projection in use — so the question of how far apart the two orders can get has an answer rather than an anecdote.

Who found it, and when

The generalisation algorithms are older than the pipelines that misuse them. Douglas and Peucker published theirs in 1973 in The Canadian Cartographer, and it is one of the most-cited papers in the subject; Urs Ramer had published the same recursion in 1972 for image processing, which is why the algorithm carries three names and no consensus about the order of them.

The commutation question is younger and has mostly been discussed as an implementation detail rather than as a property. It surfaces in the standards literature as advice — generalise in the target projection — usually without the reason, and it surfaces in bug reports as complaints that a dataset “looks different” after a projection change. The observation that the plate carrée is the fixed point of the question, being the projection for which page space is degree space, is a two-line consequence that seems not to be written down anywhere, probably because nobody wants to draw attention to how often it is the projection in use.

The secφ\sec\varphi bias is a defect against the ground and a correction for one page

The most-used pipeline in the world simplifies in degrees, and the essay’s arithmetic says that pipeline applies a tolerance that is secφ\sec\varphi tighter east–west than north–south. That is worth following through, because the bias turns out to be wrong and right in a way that explains why nobody notices it.

Against the ground it is plainly wrong. A degree of longitude is 111 kilometres at the equator and 19 kilometres at 80°, so a fixed tolerance in degrees is a ground tolerance that shrinks polewards by secφ\sec\varphi: a factor of two at 60°, 5.8 at 80°, 11.5 at 85°. A global coastline simplified this way keeps roughly six times the vertex density in the Arctic that it keeps in the tropics, for no reason anybody chose. The Canadian archipelago and the Norwegian fjords come out heavy, the Indonesian coast comes out light, and the difference is a property of the storage units rather than of either coastline.

Against a plate carrée page it is exactly right, and that is the uncomfortable half. A plate carrée sheet stretches east–west by secφ\sec\varphi — that is the whole of its distortion — so a feature at 80° is drawn 5.8 times wider on the page than its ground extent warrants. A tolerance that is secφ\sec\varphi tighter on the ground in that direction is a tolerance that is constant on the page, which is precisely what a simplification for display should be.

So degree-space simplification is not a mistake in the one case where it happens to be the identity. It is a correctly-scaled page simplification for the plate carrée, and the fixed point this essay identifies is the reason.

And it is a mistake everywhere else, in whichever direction the target’s distortion runs. Feed the same degree-simplified data to a Mercator page and the polar over-retention is compounded, because Mercator stretches north–south by secφ\sec\varphi as well and the vertices that survived are already crowded. Feed it to an equal-area page and the bias runs the other way: the polar detail is retained and then squeezed into a page area that cannot show it, so the vertices are paid for and not seen.

The general statement is the one the whole rung is about. A tolerance is meaningful only in the space it is applied in, and degree space is a space — it is the plate carrée’s page. A pipeline that simplifies in degrees has therefore chosen a target projection, silently, whatever it goes on to draw with the result.

Where the ladder goes next

Both orders in this essay honour their tolerance: no vertex either discarded is further than ε from the line drawn in its place. The next rung asks what that promise actually covers, and finds that it covers the picture and nothing else — not the enclosed area, not which side of the boundary a point is on, and not whether the curve still fails to cross itself.

Named alongside this one

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

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.

ConformalityCoordinate reference systemEqual-areaGeneralisationGround resolutionIndicatrixPipelineProjectionScale factorSimplificationToleranceUnit of measure