Measuring distortion

The sample was drawn on the page

Every mean in this collection integrates over the sphere, because that is where the ground is. A raster, a pixel loop and any figure that walks its own canvas integrate over the page instead, and the difference is exactly the covariance between the quantity being measured and the map's own area distortion — 7.2° of mean angular deformation on Miller becoming 18.0°.

The five rungs before this one audited estimators: a maximum that is a lower bound, a mean that does not exist, a lattice that cannot be equal-area, a refinement that converges on the wrong number, and the collection re-measured against all four. Every one of them took the domain for granted. The samples were on the sphere, they carried the sphere’s area element, and the only question was where on the sphere they went.

There is a second domain, and it is the one a computer reaches for first. A map is a rectangle of pixels. Walking it is a loop over two integers, needs no trigonometry, no lattice and no weighting, and produces a number that looks exactly like the number the sphere would have produced.

It is a different number, and the difference has a closed form.

One map, two samples, two answers. The same Miller cylindrical projection carrying two sets of sample points of the same size. On the left the points are uniform over the SPHERE — equal ground area between them, which is what every mean in this collection integrates against. On the right they are uniform over the PAGE, which is what a raster, a pixel loop or any figure that walks its own canvas produces. The right-hand set crowds where the map stretches, and the mean angular deformation it returns is 18.0° against the left-hand set's 7.2°.
Fig. 1 The Miller projection carrying two samples of the same size. On the left the points are uniform over the sphere — equal ground area between them, which is the measure every mean in this collection integrates against. On the right they are uniform over the page, which is what a raster produces. The right-hand set crowds where the map stretches, and it returns a mean angular deformation of 18.0° where the left-hand set returns 7.2°.

The two integrals

A mean of a quantity qq over a map is an integral divided by an area, and there are two areas available.

Over the ground, the element is dA=cosφdφdλ\mathrm{d}A = \cos\varphi \,\mathrm{d}\varphi\, \mathrm{d}\lambda, and the mean is what a person standing on the surface would average if they visited every square kilometre once. That is what distortion over a region computes and what every criterion in this collection is built on.

Over the page, the element is the projected one, and the projection’s areal scale factor ss is by definition the ratio between them: dApage=sdA\mathrm{d}A_{\text{page}} = s \,\mathrm{d}A. So the page mean is the ground mean with ss folded in as a weight,

qpage=qsdAsdA.\overline{q}_{\text{page}} = \frac{\int q\, s \,\mathrm{d}A}{\int s \,\mathrm{d}A}.

Subtracting one from the other collapses to something short enough to remember:

qpageqground=Cov(q,s)s.\overline{q}_{\text{page}} - \overline{q}_{\text{ground}} = \frac{\operatorname{Cov}(q, s)}{\overline{s}}.

The error in a page-sampled mean is the covariance between the quantity being measured and the map’s own area distortion. That is not a nuisance term. On any projection worth measuring, both quantities are largest in the same places — the corners of the sheet, the high latitudes, wherever the map is working hardest — so the covariance is large and positive, and the page always reports more distortion than the ground has.

The identity, measured

The identity is exact and it is worth watching hold, because a covariance is not the shape of error anybody expects from a sampling scheme.

The bias is a covariance, and here it is. Every sample point of Miller cylindrical's world plotted by its areal factor against its angular deformation. A page sample weights each point by its x coordinate, so the difference between the two means is exactly the covariance of these two coordinates divided by the mean areal factor — 21.834 over 2.012, which is 10.850, which is 10.850, the measured gap. The cloud slopes upward because a map's area error and its shape error are largest in the same places.
Fig. 2 Every sample point of Miller’s world plotted by its areal factor against its angular deformation. A page sample weights each point by its horizontal coordinate. The covariance of the two coordinates is 21.83 and the mean areal factor is 2.012, so the identity predicts a gap of 10.85 degrees — and the measured gap between the two ruled lines is 10.85 degrees. The cloud slopes upward because a map’s area error and its shape error have the same cause.

On Miller the covariance is 21.834 and the mean areal factor 2.0123, so the predicted gap is 10.8505°. The measured gap is 10.8505°. On the equirectangular it is 11.2920° both ways, on Mercator’s areal departure 1.2457 both ways. It holds to every digit the arithmetic carries, on every projection tested, because it is an identity rather than an approximation.

What makes it useful is that it is diagnosable in advance. A quantity uncorrelated with the areal factor is safe to page-sample; one correlated with it is not; and a person about to write a pixel loop can check which they have with one scatter plot rather than by building the sphere sampler they were trying to avoid.

The control that costs nothing

Two families of projection make the covariance vanish, and neither is the family a reader would guess.

What a page sample reports, over what the ground says. The mean angular deformation of each projection over the world, computed from a sample uniform on the page, divided by the same mean computed from a sample uniform on the sphere. 7 of the 9 return exactly one, to every digit carried, and they are exactly the equal-area projections: a constant areal factor makes the two schemes the same scheme. Every other row is above one, and none is below.
Fig. 3 The mean angular deformation of each projection over the world computed from a page sample, divided by the same mean computed from a ground sample. The rows returning exactly one are exactly the equal-area projections: a constant areal factor makes the two schemes the same scheme, and the agreement is to every digit carried rather than to a tolerance. Every other row is above one and none is below.

An equal-area projection has s1s \equiv 1, so Cov(q,s)=0\operatorname{Cov}(q, s) = 0 for any qq whatsoever and the two schemes coincide exactly. Mollweide, Hammer, Eckert IV, the sinusoidal, Gall–Peters, Behrmann and the Lambert cylindrical all return a ratio of 1.000000000, not because the sampling happened to work but because there is no reweighting to do.

A conformal projection makes it vanish the other way for the one quantity conformality kills: ω0\omega \equiv 0, and a covariance with a constant is zero. So Mercator’s angular deformation is immune too — and its areal departure is the worst case in the library, page-sampled at 1.83 against a ground value of 0.59, a factor of 3.12.

The failure is therefore invisible on both classical special cases and appears only on the compromises. An equal-area map cannot show it, a conformal map cannot show it on the property it is named for, and the projections in between — which is what a comparison of world maps is usually a comparison of — show it at between 1.7 and 2.5 times.

What the weight actually is

The weight is not an abstraction. It is a curve this collection has drawn many times under another name.

What a page sample is really weighting by. The areal scale factor along the central meridian, which is exactly the weight a uniform page sample gives a piece of ground at that latitude. A sphere-uniform sample is the flat line at one; a graticule sample is 1/cos φ, which reaches four at seventy-five degrees. Mercator's page weight reaches nine before eighty degrees, so a page-sampled statistic about Mercator is mostly a statistic about the Arctic.
Fig. 4 The areal scale factor along the central meridian, which is exactly the weight a uniform page sample gives a piece of ground at that latitude. A ground-uniform sample is the flat line at one. Mercator’s page weight passes four at sixty degrees and nine before eighty, so a page-sampled statistic about Mercator is largely a statistic about the Arctic; Mollweide’s is flat, which is what being equal-area means.

That is the same ss that makes Greenland look the size of Africa, and it is doing the same thing to the arithmetic that it does to the picture. Mercator against Peters is an argument about how much attention a reader’s eye gives the high latitudes; this is the machine version of it, and the machine’s attention follows exactly the same curve.

The consequence is worth stating in the direction a reader will meet it. A number computed by walking a Mercator raster is not a number about the world. Ground above sixty degrees of latitude, north and south together, is 12.9 per cent of the sphere out to the eighty-fourth parallel; on Mercator’s page it occupies 55.3 per cent of the rectangle, and any statistic taken off that rectangle is weighted accordingly. On Miller it is 40.2 per cent, which is why Miller’s bias is large without being the largest.

That is the whole mechanism and it is worth keeping separate from the arithmetic that follows from it. A page sample is not a bad sample of the sphere in the way an uneven lattice is a bad sample — it is a perfectly good sample of a different thing, and the different thing is the sheet of paper. Every one of its points is a real place, every quantity evaluated at it is correct, and the estimator is unbiased for the quantity it actually estimates. What is wrong is only the name on the answer.

Three schemes, and no safe one

There is a third scheme in circulation, and this ladder’s neighbour has already audited it. The ellipses are a sample, drawn at a size somebody chose measures the graticule placement — one sample per intersection of parallels and meridians, with no area element at all — and finds it overstates every mean it is used for. That scheme’s weight is 1/cosφ1/\cos\varphi; the page’s is ss. They are different biases in the same direction and they do not agree.

Three ways to average one map, none of them safe everywhere. The mean angular deformation of six projections over the world, computed three ways: over the sphere's own area, over a uniform grid of graticule intersections, and over a uniform grid on the page. The equal-area projections are exact on the page and wrong on the graticule; the equirectangular returns the same number from both wrong schemes, because its page IS its graticule; and the compromises are wrong on both, by different amounts and in the same direction.
Fig. 5 The mean angular deformation of six projections over the world, computed over the sphere’s area, over graticule intersections, and over a uniform page grid. The equal-area projections are exact on the page and overstated by between 19 and 63 per cent on the graticule. The equirectangular returns the same wrong number from both schemes. Only the ground column is a statement about the world.

The three columns cross over. On the Lambert cylindrical the ground says 30.2°, the page says 30.2° and the graticule says 48.7° — the page scheme is exact and the graticule scheme is 62 per cent high. On Miller the ground says 7.2°, the graticule 13.3° and the page 18.0° — the graticule scheme is the better of the two wrong ones. So there is no scheme a person can adopt once and be safe with, which is the practical content of the rung: the safe scheme depends on the map, and specifically on whether the map has an areal factor to weight by.

projection ground graticule page
Miller 7.18° 13.29° 18.03°
equirectangular 16.25° 27.55° 27.55°
Behrmann 26.07° 42.46° 26.07°
Eckert IV 28.07° 38.95° 28.07°
Lambert cylindrical 30.16° 48.71° 30.16°
Mollweide 31.82° 41.54° 31.82°

Reading down the third column against the first is the sharpest way to see it: the page column is right on four of these six maps and wrong by a factor of two and a half on one of the other two. No property of the sampling scheme decides that. It is decided entirely by which projections happen to be equal-area, which is a fact about the maps being audited rather than about the audit.

The equirectangular supplies the coincidence that makes the point memorable. Its page is its graticule — the projection sends λ,φ\lambda, \varphi to x,yx, y unchanged — so a uniform page grid and a uniform graticule are the same set of points, and both schemes return 27.55° against a ground value of 16.25°. One projection in the library cannot tell the two mistakes apart, and it is the one most often used as a default.

What was computed, and how

The identity above could be a restatement rather than a measurement, so the page mean is computed twice by routes that share nothing but the projection’s forward formula.

The first route is the reweighting: sample the sphere, evaluate the distortion, and carry scosφs\cos\varphi as the weight. It never touches the page at all.

The second route is the page walk, and it is the honest simulation of a raster. Lay a uniform grid over the rectangle the projection actually draws, invert every point back to a longitude and a latitude, discard the ones that land outside the region, and average the survivors with no weights whatsoever. It uses the projection’s inverse, which the reweighting does not, and it is available on twelve of the library’s twenty-four projections.

Two implementations of one number. The mean angular deformation of Miller cylindrical over the world, computed by actually laying a uniform grid on the page and inverting every point back to the sphere, against the grid's size. The ruled line is the same number obtained from the covariance identity, with no inverse involved at all: 18.053. The walk reaches 0.03 per cent of it. Nothing is shared between the two routes but the projection's forward formula.
Fig. 6 Miller’s mean angular deformation over the world from the page walk, against the size of the page grid. The ruled line is the same number from the covariance identity, with no inverse involved. The walk reaches 18.06 against the identity’s 18.03, a difference of 0.17 per cent, and the residual is the walk’s own quadrature error rather than a disagreement about the quantity.

At a hundred and forty points a side the walk returns 18.0587° against the identity’s 18.0284°, which is 0.17 per cent. Across the library the two agree to better than one per cent wherever the quantity is above the arithmetic noise floor, and the gate requires it.

The gate also requires the three things that could fail separately: that the difference equal the covariance identity to machine precision on every projection, that every equal-area projection return a ratio of exactly one, and that at least one compromise return a ratio above 1.05 — because a bias small enough to ignore would make this rung a footnote rather than a finding.

What it does to a ranking

A bias that scaled every projection alike would be harmless. This one does not, and the reason is structural: the reweighting is by each map’s own areal factor, so a map with more area distortion is punished more heavily by the very sampling scheme that is measuring it.

Over the world’s mean angular deformation the ordering does move, though less than it might: the equirectangular and Behrmann change places, because the equirectangular’s 16.25° is inflated past Behrmann’s unmoved 26.07° to 27.55°. One swap in ten is a modest effect and it is the honest number.

The reason it is only one is worth having, because it is the same reason the areal ordering is stable under the aggregation exponent. The seven equal-area projections in this library are not reweighted at all, so they hold their positions relative to one another exactly; only the three maps with an areal factor move, and they move as a block, all upward. A reordering needs two things to move past each other, and here nearly everything either stays still or rises together.

That will not survive a library with more compromises in it. The three maps that do move rise by 1.70, 2.23 and 2.51 times, which is a spread of half a factor between maps whose ground values differ by less than that — so a comparison between two compromise projections, which is the comparison an atlas designer actually makes, is exactly the comparison this scheme is least able to make correctly.

The larger effect is on the magnitude, and magnitudes are what get quoted. A page-sampled comparison reports Miller’s shape error as two and a half times what it is, and the equal-area projections’ as exactly what it is, so the gap between a compromise and an equal-area map closes by a factor that has nothing to do with either map. The average was a choice of norm shows how much freedom the aggregation exponent already hands the person doing the comparing; the domain is a second such freedom, and unlike the exponent it is usually not chosen at all — it is inherited from whatever loop the number came out of.

What this collection does

The audit is only worth running if it is run on the machinery here, and the answer has two halves.

Every number in these essays goes through one region sampler, which walks latitude and longitude and carries cosφ\cos\varphi as the weight. There is no page loop anywhere in the measurement path, and there never was — not by vigilance but because the libraries were written around the sphere before any of them drew anything. So no published mean here is page-sampled, and the identity above says so exactly: a page-sampled version of any of them would differ by a covariance the machinery can now compute.

Every picture is a different matter, and the honest statement is narrower than a clean bill. A shaded distortion field on any of these pages is a raster of coloured cells, laid out on a grid of longitude and latitude and drawn onto a page — so its cells are equal in coordinates and unequal in ground area, and a reader averaging the colours by eye is graticule-sampling. That is precisely the bias the ellipses are a sample measures for the indicatrix field, arriving at the shaded fields by the same route, and nothing in this collection corrects it. It cannot be corrected by drawing, only by choosing a projection whose page is equal-area, which is why the sampler comparison in that essay is drawn on Mollweide.

Where the model stops

This is about sampling, not about resampling. Reprojecting a raster invents values is the neighbouring failure and a different one: there the page grid is the output and the question is what interpolation does to the numbers stored in it. Here the page grid is the instrument, and the quantity being measured exists continuously on the sphere before any grid touches it.

The identity assumes both means exist. A mean that does not exist can still be printed is the case where the ground mean diverges; page-sampling a divergent quantity produces a covariance that diverges too, and the identity becomes a statement about two infinities. Every projection here is measured over a band to 84° for exactly that reason, and the numbers move with the band.

A real raster is not a uniform page grid. It has a stated extent, a stated resolution and usually a clip, and a clipped rectangle changes the weights again. The measurement here is of the clean case, which is a lower bound on the confusion available.

And the page walk inherits the earlier rungs’ problems. Its inverted points are a sample of the sphere too, an irregular one, so the worst point is not on the grid applies to any maximum taken over it, and there is no equal-area lattice on a sphere describes what its spacing is doing. Nothing here fixes those; it adds one on top.

The generalisation

The rule is that an average has a domain, and a program inherits its domain from its loop.

Nobody chooses to average over the page. They choose to write a loop over a raster, or to sample a canvas, or to count pixels of a colour, and the domain arrives with the data structure. That is what makes it different from the aggregation exponent, which somebody at least has to type: this one is a decision made by the shape of the array.

The same shape appears everywhere a picture is measured. Counting the pixels of a colour on a thematic map measures projected area, which is why a choropleth is read by area and a dot map’s density is partly the projection’s; computing an area needs a surface is the same statement about a polygon. In each case the honest fix is one multiplication by a factor the machinery already has, and in each case the factor is invisible because the loop that omits it looks complete.

The cheap habit is a question to ask of any number computed from a map: what was the loop over? If it was over pixels, the number is weighted by the projection. If the projection is equal-area, that is harmless and exactly so. If it is not, the weight is the areal factor, the bias is a covariance, and both are computable from what is already on the page.

Who found it, and when

The mathematics is the change-of-variables formula and it is not in dispute. Every treatment of map projection distortion that computes a regional mean states the area element, and the good ones state it prominently — the criterion of Airy in 1861 is defined with cosφ\cos\varphi in it, and so is Kavrayskiy’s.

What is missing is the connection to how the number is produced now. A regional distortion figure in 1861 was a hand quadrature over a table of latitudes, and the person doing it could not avoid seeing the weight because they had to write it in a column. A regional distortion figure today is often a loop over a raster of the projection, where the weight is not omitted so much as never raised, and the result is a number of the same name computed against a different measure.

The one part of the subject that has faced it squarely is remote sensing, where the difference between a pixel’s page area and its ground area is a routine correction with a name, and where nobody would report a mean reflectance off an unprojected grid without saying so. That discipline arrived at the habit because its numbers are physical and the error shows up against instruments. Cartography’s distortion figures are not checked against anything external, which is exactly the situation in which a systematic bias can survive for a century looking like a value.

Where the ladder goes next

Five rungs asked what a sample does to a number, and this one asked what the sample was drawn on. Both take for granted that the refinement stops somewhere, and that somebody decided where — the next rung is about that decision, which is almost always made by watching a number stop moving, and about the cases where the thing that stopped moving is not the thing being computed.

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.

Angular deformationArea weightingAreal factorBiasCovarianceEqual-areaEstimatorGraticuleQuadratureRasterResamplingSamplingVerification