Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cupola projection #209

Open
TomBor opened this issue May 5, 2021 · 14 comments
Open

Add Cupola projection #209

TomBor opened this issue May 5, 2021 · 14 comments
Assignees

Comments

@TomBor
Copy link

TomBor commented May 5, 2021

A beautiful new world map equal-area projection created by Weia Reinboud : https://www.tandfonline.com/doi/full/10.1080/23729333.2020.1862962

All the info rmationI found :

@Fil
Copy link
Member

Fil commented May 5, 2021

Projection invented and developed by @WeiaR.

A comment by the author in the PROJ issue gives the following formula:

x=1.6188566*sqrt(2/(1+0.530815*sin(asin(0.7264*sin(u)+0.2587011))+0.8474875* cos(asin(0.7264*sin(u)+0.2587011))*cos(0.5253*v-0.1010612291)))* cos(asin(0.7264*sin(u)+0.2587011))*sin(0.5253*v-0.1010612291)*0.9701
y=1.6188566*sqrt(2/(1+0.530815*sin(asin(0.7264*sin(u)+0.2587011))+0.8474875* cos(asin(0.7264*sin(u)+0.2587011))*cos(0.5253*v-0.1010612291)))*(0.8474875* sin(asin(0.7264*sin(u)+0.2587011))-0.530815* cos(asin(0.7264*sin(u)+0.2587011))*cos(0.5253*v-0.1010612291))/0.9701

where (u,v) = (lat, lon) in radians.

https://observablehq.com/@fil/cupola-projection

The inverse projection is obtained by the Newton-Raphson 2D method (already developed in d3-geo-projection).

cupola-projection

@Fil Fil self-assigned this May 5, 2021
@WeiaR
Copy link

WeiaR commented May 5, 2021

Nearly OK. The only problem is the borders of the map. The central meridian is 11.023 degrees (east), this is built in in the equations. This leads to
left boundary -180+11.023 degrees and
right boundary 180+11.023 degrees
In the adapted version above boundaries are rounded to the nearest 10 degree, I think, which gives an asymmetric map, left and right corners are not at the same height.

@Fil
Copy link
Member

Fil commented May 5, 2021

Thank you @WeiaR for the close look (and for the magnificent projection!). I've just fixed my code, as well as the image above.

I'll probably tweak the implementation a bit to make it more "d3-friendly" (we prefer antimeridian clipping at -180, 180, and rotating the aspect). But it won't change the map.

@WeiaR
Copy link

WeiaR commented May 5, 2021

The previous picture had more problems. I'll look at the new one.

@WeiaR
Copy link

WeiaR commented May 5, 2021

It's perfect! I understand preferences for round numbers, but one purpose of my project was to see what happens when common preferences were left out. I started with the most compact ordening of all continents, which is a big circle having its center in Gabon. Accidentally the borders of the map then are so close to the international date line that I took that as boundary, more precise where the date line is between Siberian and Alaskan isles (Diomede and Big Diomede). When cartographers very much prefer round numbers I could look at it, how much worse it will become. But all parameters than change and so the equations!

@jrus
Copy link

jrus commented May 6, 2021

@WeiaR Nice work!

One question I have when reading the paper: was it your original expectation/intention to have a shape pulled together at the north pole and stretched out at the south pole? In retrospect it is what someone might expect to happen if minimax optimizing to preserve the shapes of Greenland, New Zealand, Chukotka, etc. while entirely ignoring Antarctica, but I can also imagine the resulting optimized shape being a surprise at first.

@WeiaR
Copy link

WeiaR commented May 6, 2021

Thanks. My only aim was to make an asymmetric projection because land masses aren't equally spread on the globe.. I had no idea what could be the outcome. As you can see on my website figure 9, very different forms are also possible. It in fact isn't optimizing, the criterion of making the worst points on land as good as possible is finding a solution to a set of equations. Rather nasty equations, I only could do it numerically. The solution has 4 equally good worst points. All other points on the continents have less distortion.

@jrus
Copy link

jrus commented May 6, 2021

This kind of optimization of the Chebyshev distance (a.k.a. L∞ distance) is commonly seen with conformal projections (optimizing for minimal worst-case scale variation), e.g. the Eisenlohr projection is the "optimal" conformal projection in this sense of the globe with a cut along one meridian. Hammond contracted physicist Mitchell Feigenbaum to make a whole set of L∞-optimized conformal projections of various countries and continents for their 1992 world atlas.

For a conformal projection it can be proven that the L∞-optimal projection of a particular contiguous region of the sphere will have constant maximal scale along the boundary. For equal-area projections I don't think an L∞ optimized map in general has constant shear all along the boundary, but it should still tend toward having similar worst-case shear at various points along the chosen boundary because distortion can be reduced in one place by increasing it somewhere else, so an L∞ optimization method will tend to reduce the worst-case distortion on the map by spreading it around, and only stop when there’s no way to perturb the parameters in a way that simultaneously reduces distortion at all of the most-currently-distorted points.


I’d be curious to see what happened if the same projection family were optimized using a least squares (L2 distance) criterion instead, perhaps with continental points weighted by population.

@WeiaR
Copy link

WeiaR commented May 7, 2021

I'm not a mathematician, so maybe am not using the proper words. But I immediately looked up how to pronounce Chebyshev in Russian (chebishóf).
Why I tend to call it a solution is because I have a finite set of candidate worst points on the continents (89, see picture) and a finite set of parameters (5) and therefore a finite set of what I call solutions. With zero active parameters there is 1 worst (=most distorted) point on the map, with 1 parameter 2 points can be made equally worst, etcetera. Due to the irregularity of the polygon with 89 points it stops at 4 worst points. So take 4 out of the 89 points and find out when they have the same distortion. When there are more solutions, more maps, less distortion is the best solution. In the end there is just one set of 4 candidate points having exactly the same distortion and being the best of all solutions. That's the Cupola.
Screenshot 2021-05-07 at 09 32 25

@WeiaR
Copy link

WeiaR commented May 7, 2021

I started with least squares, wanted to summate them over the continents, but then thought: power 2 is arbitrary, why not power 3 or 4? This leaded to 'power infinite', so only look at the worst points.
Your idea of least squares and weighted points is interesting. The dots on my maps have the same area (4 square degrees), you only have to find out how many people are living there, nearly 3000 points...

@jrus
Copy link

jrus commented May 7, 2021

The biggest reason to use least squares (L2 distance) is that it is the most mathematically/computationally inexpensive and convenient. L∞ distance (worst-case error) and L1 distance (sum of the absolute values of all errors, sometimes called "taxicab distance") are also commonly used. L1 distance is very sensitive to small errors over a large number of points but barely penalizes high-error outliers; L∞ distance very harshly penalizes high-error outliers but is completely insensitive to marginal changes to errors everywhere else. L2 distance is in between.

@waldyrious
Copy link

Just adding a visual reference for those following along:

(source)

@WeiaR
Copy link

WeiaR commented Apr 11, 2022 via email

@WeiaR
Copy link

WeiaR commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants