On distortion and optimal projections

General discussion of map projections.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: On distortion and optimal projections

Post by Milo »

quadibloc wrote: Thu Jan 28, 2021 8:46 amYou are absolutely correct!
I had to think about this for a while to see how it was that you could be correct, and yet I accepted the statement by Daniel Strebe as not only correct, but obviously correct.
Many things that seem obviously correct in mathematics actually aren't :)

I suppose it's not something you gave too much thought because Strebe's claim is correct for the kinds of regions that people are usually most interested in mapping, such as hemispheres or the meridian-interrupted sphere (which are actually both special cases of my digon, with theta = pi and theta = 2*pi respectively). But when one makes a bold claim like "these observations hold regardless of the region’s shape on the globe", it's worth double-checking.
quadibloc wrote: Thu Jan 28, 2021 8:46 amThe sphere is not a reducible surface.
I'm not familiar with this terminology. It's not defined on Wikipedia.
quadibloc wrote: Thu Jan 28, 2021 8:46 amSo if the area on the globe were, say, in the shape of a narrow ellipse, one could match the perimiter-area relationship on a plane by using a less narrow ellipse, for example. So, indeed, it is possible to avoid singularities and achieve the result you note. (Unlike the case of a quadrant of the sphere, though, this would involve difficult mathematics, most likely elliptic integrals.)
It should also be possible with angled regions, such as the digon with theta < pi/2 that I discussed above, but you would have to make sure that those angles are preserved between the plane and the sphere. This cannot be satisfied if you try to project the digon in the most intuitive manner (as a lens), but there exist shapes that do satisfy this requirement, though as you say, the projection for such a shape would involve difficult mathematics. For the projected shape of the digon to be convex, it would have to satisfy sin(theta)/theta > 8/pi^2 (or theta < approximately 1.0988 radians or 62.958 degrees).
quadibloc
Posts: 292
Joined: Sun Aug 18, 2019 12:28 am

Re: On distortion and optimal projections

Post by quadibloc »

Milo wrote: Thu Jan 28, 2021 4:10 pm
quadibloc wrote: Thu Jan 28, 2021 8:46 amThe sphere is not a reducible surface.
I'm not familiar with this terminology. It's not defined on Wikipedia.
A reducible surface is simply one that can be flattened out to a plane without stretching. The top of a cone or the side of a cylinder are examples of reducible surfaces, which is why conic and cylindrical map projections, in addition to azimuthal map projections, are important in cartography.
When Wikipedia fails you, try "reducible surface" in Google Books.

EDIT: Apparently this is bad advice. When I tried it myself, I got two kinds of results. One gave a completely different mathematical definition: a surface the equation of which can be factored. The other is a surface that can be attacked by alkalis or something like that - the opposite of an oxidizable surface, I guess. But it is a term used in cartography.

Or maybe not. Apparently the current term for this is developable surface.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: On distortion and optimal projections

Post by Milo »

quadibloc wrote: Thu Jan 28, 2021 7:38 pmOr maybe not. Apparently the current term for this is developable surface.
Right. I know what those are.

There actually exist non-developable surfaces where circles have a smaller area-to-squared-perimeter ratio than on the Euclidean plane (as opposed to larger, as with the sphere).

The simplest such surface is the so-called "hyperbolic plane", which has constant negative curvature (as opposed to the sphere's constant positive curvature, ellipsoids' non-constant but still everywhere-positive curvature, and the Euclidean plane's constant zero curvature). I've actually done some work cataloguing map projections of the hyperbolic plane - all of the more basic spherical projections (cylindrical, azimuthal) have straightforward hyperbolic analogues, though many hyperbolic map properties are the exact opposite of their spherical versions. There are some ways in which they're harder to work with, not least of which is that there are no hyperbolic planets, so I have nothing to map. There are also some ways in which they're easier, principally that since it's a subject far fewer people care about, there's still a lot of low-hanging fruit left to pick :)

I've invented a few map projections of the 3-sphere, too :)

Haven't really looked at hyperbolic 3-space, but it's probably more of the same.
quadibloc
Posts: 292
Joined: Sun Aug 18, 2019 12:28 am

Re: On distortion and optimal projections

Post by quadibloc »

Reviewing my web site, I found that while I used the correct term in my pages on map projections, I had used the wrong term, my memory having played tricks on me, on a page about computer keyboards where I discussed how the IBM Personal Computer used keyboards where the keys had a cylindrical surface, instead of a spherical one, so that people could use transparent stickers on the faces of the keys. So this discussion led to me correcting that page!

But I have heard of the hyperbolic surface, since it's used to illustrate Lobachevskian space in contrast with the sphere, illustrating Riemannian space, in popular accounts of the General Theory of Relativity.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: On distortion and optimal projections

Post by Milo »

Let's have another look at conformal projections.

I've run into the Lagrange projection before, but hadn't thought much of it, due to the blatant, extreme exaggeration of Antarctica. However, its mention in this thread convinced me to take another look at it, and I realized that I haven't been giving it enough credit.

To start:
dummy_index wrote: Sun Jan 12, 2020 5:12 amI don't know whether Lagrange is minimum total normalized area. But, in https://en.wikipedia.org/wiki/Fracture_mechanics, it is natural that singular point will appear at the end of interruption (ex. both pole with cutting 180° meridian.)
But Lagrange is not fit for min/max criterion... [/no conclusion]
I do think Lagrange can be proven to be optimal by this metric. Specifically...

Conjecture: If a region can be conformally mapped to a circle in such a way that the point of minimum scale is at the center, then that map has minimum area of all (normalized) conformal maps of the region.

Sketch of proof: Every conformal map will necessarily have the same conformal radius at the point which corresponds to the center of the circular projection (when normalized so that scale is the same at this point). (Note that it is possible the point of minimum scale of an arbitrary projection is somewhere other than the center, but since this makes the projection worse, it suffices to show that the projection cannot be better than the circular projection even when this pitfall is ignored.) Therefore, the challenge becomes to determine the shape with the minimum possible area for a fixed conformal radius, or equivalently, the shape with the maximum possible conformal radius for a fixed area.

This is the hard part, because I haven't found any sources that clearly confirm what that shape would be. Conformal radii do not seem to be a well-documented topic. However, there does seem to be a paper (which is hidden behind a paywall, but it's cited in a few other papers that aren't) which proves a theorem that, among n-sided polygons with a fixed area, the one with the maximum conformal radius is the regular polygon. Since any shape can be approximated arbitrarily closely by a many-sided polygon, this does seem to suggest that the overall optimum would be achieved by a circle, even if that's a rather roundabout way of doing things.

So...?

In the case of the meridian-interrupted sphere, the Lagrange projection does indeed map it onto a circle with minimum scale at the center, therefore it should have the minimum possible area of any such projection.

Indeed, Lagrange does end up looking pretty good, as far as conformal projections go. When I visually compare the Eisenlohr and Lagrange projections (with central meridian 0) side by side, the Lagrange projection clearly shows less distortion at Alaska, Australia, and East Asia, while (of course) being about the same for Africa. The only place Eisenlohr is really obviously better is Antarctica, and maybe Greenland. However, since the projection space we were optimizing among was "maps interrupted along a single meridian", and such an interruption will always pass through Antarctica, it was a foregone conclusion that Antarctica couldn't possibly end up looking good anyway. (I would be interested if anyone can calculate the exact contour line of where the Lagrange projection starts having worse distortion than the Eisenlohr projection. I have done so.)

This is really what bugs me about conformal projections: that the parts of the projection which are most heavily distorted (nearest to the interruptions or singularities) are drawn the largest, while the center of the map (which is where you usually try to put the stuff that interests you most) is drawn the smallest, so that an excessive amount of space is wasted on exactly the parts of the map that you shouldn't be paying attention to.

(At least, for spherical maps. For hyperbolic maps, it's the opposite: the center of the map is drawn the largest. But hyperbolic projections have their own problems.)

...But is that always the case? After all, equal-area maps usually have their point of minimum angle distortion in the center, but as I showed above, that generalization can fail for certain shapes.

And indeed, much as I did with the Hammer projection, it's easy enough to use the opposite of the Lagrange process (double rather than halve the Mercator projection) to map a quadrant into a circle. Attached below is the resulting projection, showing the same region as before, but now conformally rather than equal-area.
antilagrange.png
antilagrange.png (147.96 KiB) Viewed 37595 times
It is easy to see from the graticule that this projection has minimum scale at the top and bottom sides of the map (the poles), and maximum scale at the left and right sides of the map, with intermediate scale in the center. (Note that this is still quite different from having low scale along the entire boundary of the map, which so far still hasn't been proven either possible or impossible.)

Since the point of minimum scale is not at the center, the above conjecture does not apply here. It is not at all obvious what the optimal projection would be for this region (or other digons), either by the Eisenlohr criterion (minimize ratio of maximum to minimum scale / have constant scale along the boundary) or the Lagrange criterion (minimize total area). The latter might still be this projection, or not. The former is extremely unlikely to have anywhere near convenient formulae (the Eisenlohr projection's formulae are already pretty nasty, even if they're technically closed-form). Maybe dummy_index could wrangle a numerical approximation.
dummy_index wrote: Tue Jan 07, 2020 6:38 amNeedless to say, Eisenlohr projection is a projection least area-error in the meaning of "infinity norm." In contrast, attempt to minimize "Entire strain energy" is "Euclidean norm" context and may lead differ answer (parhaps August projection, or maybe Lagrange projection.)
daan wrote: Sat Jan 11, 2020 1:39 amCould you elaborate on how a least area-error metric could (or should) depend on anything except total normalized area? Why would any norm be relevant? Thanks.
I do understand what dummy_index is doing here.

For any p, it is possible to define the following metric:
metric = (integral_over_the_sphere(scale^p) / (4*pi))^(1/p) / minimum_over_the_sphere(scale)
Or for regional maps:
metric = ((integral_over_the_region(scale^p) / area_of_the_region)^(1/p) / minimum_over_the_region(scale)
(Where, of course, area_of_the_region = integral_over_the_region(1).)

Note that this can be mathematically understood as the (renormalized for better behavior) p-norm of a vector space of uncountably-infinite dimension, hence the use of the "norm" terminology.

When p = 1, then this metric is simply the total area of the projection, and so it is minimized (among meridian-interrupted maps) by the Lagrange projection. The Eisenlohr projection is not minimal by this metric, but it is at least finite, unlike the Mercator projection.

When p = infinity (or in the limit as p goes to infinity, if you want to be pedantic), then this metric is the ratio of maximum to minimum scale, and so it is minimized (among meridian-interrupted maps) by the Eisenlohr projection. The Lagrange projection is pessimal, as despite having finite total area, the scale factor approaches inifinity near the polar singularities.

It is in principle possible to choose any other value of p, for example 2, and attempt to minimize the resulting metric, though this metric will not have as obvious a practical "meaning" as the p = 1 and p = infinity cases. It's only a true norm for p >= 1, but the metric is actually well-defined for any real value of p, as well as positive and negative infinity. (Though the case of negative infinity is trivial, as the metric as defined is always equal to 1. This suggests the possibility of taking the ratio of two p-norms to create an even more extended family of metrics...)

By taking p as a parameter for the projection, one could, in theory, produce a generalized Lagrange-Eisenlohr projection that allows a smooth transition between the two extremes, although, once again, it is extremely unlikely to have convenient math. (And it probably still won't include the August epicycloidal projection, which really has no justification beyond "one guy thought this looks good".)

One could also combine this with varying the length of the interruption, as investigated by dummy_index, for a two-parameter projection (or three-parameter projection, if you run with the ratio-of-two-norms idea). In the special cases where the interruption is either just a single point or an entire great circle, I'm pretty sure that the resulting projection is simply the stereographical projection regardless of the choice of p.

Of course there exist still more possible ways to measure the worth of a map, for example one could attempt to apply a p-norm to logarithmic scale rather than the scale itself, so even this generalized Lagrange-Eisenlohr projection doesn't encompass all of the conformal projections anyone could want. (And optimization isn't everything. For example, the Mercator projection is useful not for optimizing any particular numerical value, but rather because it is the only conformal cylindrical projection, and therefore the only projection which preserves compass directions.)

Though actually, it turns out that one case of logarithmic scale is already included. If you take the limit as p goes to 0, then the 0-"norm" (it's not a true norm) of scale equals the 1-norm of logarithmic scale. I'm not sure if any other logarithmic norm is really worth using anyway...

All this is specific to conformal projections. One could attempt to apply similar metrics to general-case projections, but this requires a little more careful thinking of exactly what property is being integrated or minimized. Maybe more on that later.
Last edited by Milo on Wed Feb 15, 2023 3:58 am, edited 1 time in total.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: On distortion and optimal projections

Post by Milo »

I've worked out a conformal world-in-a-circle projection that allows interrupting along a great circle arc of any length. Choosing a length of 180 degrees, naturally, gives the Lagrange projection.

According to my previous conjecture, these are therefore the minimum-area conformal projections whenever the point of minimum scale is at the center, which appears to be the case when the interruption has a length less than or equal to 180 degrees (I haven't proven this, it just empirically seems to be the case). The projection is still valid for longer interruptions, but is no longer optimal there.

For these examples, I chose a central meridian of 27 E / interruption meridian of 153 W. This was chosen because the latter meridian is halfway between Cape Blanco, Oregon, United States and East Cape, North Island, New Zealand (the New Zealanders apparently aren't very imaginative with names), the westernmost and easternmost major landmasses between 45 N and S. With a full 180-degree interruption, this is an inconvenient choice because the interruption passes through Alaska. However, with a shorter interruption, Alaska and Antarctica get spared regardless, and so the interruption passes only through the Pacific Ocean.

Sorry, no graticules or distortion charts here. I just cobbled up a very simple program to make these.

With interruptions 45 on the right, 90 on the top left, and 135 on the bottom (I had to put these in one image because the forum software will only let me attach three images at a time):
circular-27E-45-90-135.png
circular-27E-45-90-135.png (151.51 KiB) Viewed 37588 times
In the 90-interruption version, the United States (including Hawaii, which I hadn't counted as a "major landmass") comes off relatively poorly, but the rest of the map isn't that bad, except for the extreme exaggeration of the Pacific Ocean.

The 45-interruption version exaggerates the Pacific Ocean even more. In the limit as the interruption goes to 0, you get the stereographic projection, and so the Pacific Ocean gets exaggerated to infinite size! Normally when using the stereographic projection you cut it off at some arbitrary distance, and logically the same might also be a good idea for these almost-but-not-quite stereographic projections, but I'm not doing that here - these areas are finite, so I'm showing them, even if they're unreasonably large.

The 45-interruption version is already very close to the stereographic projection, with the difference being extremely minor out to 135 degrees from the center, which includes most land on Earth (excluding Hawaii and a few other Pacific islands).

In the 135-interruption version, the interruption reaches Alaska, and so it's mangled as badly as you expect, but the rest of the world looks better than with a shorter interruption, while Antarctica looks far better than when the interruption is long enough to pass through it (though its size is exaggerated).

With interruption 180, you just get the normal Lagrange projection, but here it is anyway, as drawn using the same program as the others:
circular-27E-180.png
circular-27E-180.png (118.48 KiB) Viewed 37588 times
With interruptions 225 on the right, 270 on the top left, and 315 on the bottom (remember that these are no longer optimal projections):
circular-27E-225-270-315.png
circular-27E-225-270-315.png (495.32 KiB) Viewed 37588 times
The interruption now doesn't stop at the south pole, but continues right on through out the other side of Antarctica, splitting it into two. The interruption now also passes through Europe (in the last map, all the way through to the Mediterranean Sea and the coast of Africa), which means that the western part of Europe - technically west of the 27 E meridian, but here interpreted as being "east" of the extended 153 W meridian - is drawn upside-down immediately to the right of the map's left edge.

These last three maps are obviously pretty bad. The first four were pretty good away from the interruptions (with the quality of most of the world increasing as the interruption is lengthened, at the expense of the regions very close to the interruption), but here even the 270-degree map is little more than a map of Africa surrounded by some trash, and even Africa is noticeably stretched. The 315-degree map has almost no recognizable land... unless you look closely, and realize that the Americas don't even look that bad. Here, like in other conformal projections, the least-distorted regions are the smallest.

The 225-degree map isn't too horrible, by comparison, but it's still unfortunate for Scandinavia. And remember, there's probably a better map for the same interruption.

Here are the formulae I used:
Convert (longitude,latitude) to (x,y): wrote: azimuth = atan2(sin(longitude),tan(latitude));
circle = 2*atan(tan(acos(cos(longitude)*cos(latitude))/2)*tan(interruption/4));
longitude = atan2(sin(azimuth),cot(circle))/2;
latitude = asin(tan(asin(cos(azimuth)*sin(circle))/2));
azimuth = atan2(sin(longitude),tan(latitude));
circle = tan(acos(cos(longitude)*cos(latitude))/2);
x = sin(azimuth) * circle;
y = cos(azimuth) * circle;
Convert (x,y) to (longitude,latitude): wrote: azimuth = atan2(x,y);
circle = 2*atan(hypot(x,y));
longitude = atan2(sin(azimuth),cot(circle))*2;
latitude = 2*atan(cos(azimuth)*sin(circle));
azimuth = atan2(sin(longitude),tan(latitude));
circle = 2*atan(tan(acos(cos(longitude)*cos(latitude))/2)/tan(interruption/4));
longitude = atan2(sin(azimuth),cot(circle));
latitude = asin(cos(azimuth)*sin(circle));
If there is a simpler formulation, I haven't found it.

The given code always projects onto a circle of radius 1, which is convenient if you want the projection to fit in an image file of predetermined resolution. If you want to normalize the projection so it has scale 1 at the center, then you need to multiply by 4/tan(interruption/4) in each direction, for a total area of 16*pi/tan(interruption/2)^2.

In a formula-free way, what I'm doing here is:
  1. Project the globe onto the plane with the stereographic projection.
  2. Shrink (for interruptions shorter than a meridian) or grow (for interruptions longer than a meridian) this map so that the interruption equals exactly one-half of a great circle.
  3. Project back from the plane onto the globe with the stereographic projection.
  4. Project the globe onto the plane with the Mercator projection.
  5. Shrink this map by a factor of 2 in each direction.
  6. Project back from the plane onto one hemisphere of the globe with the Mercator projection.
  7. Finally, project the hemisphere of the globe onto the plane with the stereographic projection again.
The last four steps are the Lagrange projection, as previously explained on quadibloc's website.

Project-shrink-unprojecting the Mercator projection is actually pretty simple in normal coordinates (longitude = longitude/2, latitude = asin(tan(latitude/2))), and project-shrink-unprojecting the stereographic projection is pretty simple in transverse coordinates (since all the stereographic projections in the process are in equatorial rather than polar aspect). It's just the repeated coordinate conversions that complicate things.
Last edited by Milo on Tue Dec 06, 2022 4:20 pm, edited 2 times in total.
quadibloc
Posts: 292
Joined: Sun Aug 18, 2019 12:28 am

Re: On distortion and optimal projections

Post by quadibloc »

Ah. Using Stereographic projections to map the whole world to the whole world at a different size, I did the same thing on my pages with August's conformal as you are doing with Lagrange's projection.
Image
But instead of reducing the interruption below 180 degrees, in this example I increase it to 230 degrees.
Milo
Posts: 271
Joined: Fri Jan 22, 2021 11:11 am

Re: On distortion and optimal projections

Post by Milo »

quadibloc wrote: Thu Jan 28, 2021 8:46 amSo if the area on the globe were, say, in the shape of a narrow ellipse, one could match the perimiter-area relationship on a plane by using a less narrow ellipse, for example. So, indeed, it is possible to avoid singularities and achieve the result you note [that is, an equal-area projection that is conformal on the boundary]. (Unlike the case of a quadrant of the sphere, though, this would involve difficult mathematics, most likely elliptic integrals.)
Milo wrote: Tue Feb 02, 2021 7:17 amIt is easy to see from the graticule that this [conformal] projection has minimum scale at the top and bottom sides of the map (the poles), and maximum scale at the left and right sides of the map, with intermediate scale in the center. (Note that this is still quite different from having low scale along the entire boundary of the map, which so far still hasn't been proven either possible or impossible.)
I've found a little more on this.

The Miller oblated stereographic projection is designed to optimize, by the Eisenlohr criterion (constant scale at the boundary), the conformal projection of an elliptical region. (I'm not 100% sure what is meant by an "ellipse" here. The shapes on the plane centainly look like ellipses, though I can't tell offhand if they're perfectly elliptical, or if they also correspond to an ellipse on the sphere. How do you even define an "ellipse" on a sphere? You can't use the "affine transformation of a circle" definition. The focal-point definition, then?) You can see from the distortion chart on that page that it has a dark spot (representing greater scale) in the center, surrounded by a white region (representing minimum scale). Therefore, if cut at the right contour line, you would have a conformal projection that has constant minimum scale along its boundary. Presumably, the more oblate your projection, the larger the region you can cut in this way.

The only source I've found on the oblated stereographic projection's formulae is here, which is somewhat awkward (skips straight from a more generalized version whose properties I'm not sure of to a more specific version matching the exact aspect used by Miller, with little explanation), but looks like it isn't actually too complicated if you take the time to parse it (the forward direction uses no special functions, though the backward direction needs to be numerically approximated).

Elsewhere, I've found rumors of a Snyder oblated equal-area projection, though the fragment of the original introducing paper that I've been able to find describes it as "its lines of constant distortion follow approximately oval or rectangular paths", i.e., not exactly elliptical (and as we've seen earlier in this thread, having constant distortion at the boundary is not a sufficient condition for optimality for equal-area projections, though it's probably a necessary condition). Still, it seems likely to be a good starting point for an equal-area map that's conformal at the boundary without singularities, though I don't see a distortion chart anywhere, and it might be possible to improve on it.

Of course, the practical use of these projection isn't so much their behavior at the boundary, but rather their ability to depict a minimum-distortion map on an oblate region (while, of course, the ordinary azimuthal projections are optimal on a circular region).
Post Reply