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 Airocean projection (formerly Dymaxion) #4303

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

plouvart
Copy link

@plouvart plouvart commented Nov 1, 2024

  • Closes Add Dymaxion/Fuller Projection #232
  • Tests added
  • Added clear title that can be used to generate release notes
  • Fully documented, including updating docs/source/*.rst for new API

@plouvart plouvart changed the title Add Airocean projection (formerly Dymaxion) #232 Add Airocean projection (formerly Dymaxion) Nov 1, 2024
src/projections/airocean.cpp Outdated Show resolved Hide resolved
src/projections/airocean.cpp Outdated Show resolved Hide resolved
@plouvart
Copy link
Author

plouvart commented Nov 1, 2024

Seems like cppcheck is complaining about some unused variable, despite the fact that it is used next line.
Edit: just saw your fix above :)

@rouault rouault added this to the 9.6.0 milestone Nov 1, 2024
@rouault
Copy link
Member

rouault commented Nov 1, 2024

A few typos in the doc reported in https://github.com/OSGeo/PROJ/actions/runs/11632419978/job/32395481110?pr=4303 . For words which are legitimate and must be allowed, you can add them in docs/source/spelling_wordlist.txt

@plouvart
Copy link
Author

plouvart commented Nov 1, 2024

Thanks for the fix for the out of projection domain error

accept 5200000 26800000
expect 123.33794956763194 6.861286881197438
accept 2600000 22300000
expect 147.63769509437498 15.818879769693432
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plouvart could you add a test point that triggers the out-of-projection-domain error ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I'll do that in a few minutes

Copy link
Member

@mwtoews mwtoews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions and comments below.

docs/source/operations/projections/airocean.rst Outdated Show resolved Hide resolved
docs/source/references.bib Outdated Show resolved Hide resolved

Original Reference:
Robert W. Gray (1995) Exact Transformation Equations for
Fuller's World Map, Vol. 32. Autumn, 1995, pp. 17-25.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Fuller's World Map, Vol. 32. Autumn, 1995, pp. 17-25.
Fuller's World Map. Cartographica, 32(3), 17-25.
https://doi.org/10.3138/1677-3273-Q862-1885

@plouvart
Copy link
Author

plouvart commented Nov 6, 2024

@mwtoews I saw your comments. Those fixes seem fair. I'll get on those as soon as a I have some free time

@rouault
Copy link
Member

rouault commented Nov 10, 2024

a few extra tests to check the behavior of +orient would be nice

@plouvart
Copy link
Author

a few extra tests to check the behavior of +orient would be nice

Tests seem to fail in builtins, but I see no error about airocean specifically. What could be the reason?

test/gie/builtins.gie Outdated Show resolved Hide resolved
// By default the resulting orientation of the projection is vertical
// the following transforms are used to alter the projection data
// so that the resulting orientation is horizontal instead
constexpr double orient_horizontal_trans[4][4] = {{0.0, -1.0, 0.0, 36843762.068421006}, {1.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 1.0}};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the value 36843762.068421006 specific to the use of the GRS80 ellipsoid ?
And I suspect that P->left and P->right shouldn't be overridden, and P->a not used directly, to let the generic code in src/fwd.cpp and src/inv.cpp do the scaling from the unit ellipsoid to the target one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plouvart gentle ping w.r.t my above question

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @rouault
Sorry for the lack of response over the last few week's. Lots of personal and work related obligations.
I will have time for a closer look at the issue this week end.

Copy link
Author

@plouvart plouvart Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rouault
I remember that I got the inspiration for the P->right, P->left and P->a lines from the s2 projection file
I didn't know that src/fwd and src/inv does that for us automatically. I can remove those lines.

About the 36843762.068421006 value, it is related to the final scale of the airocean space whose dimensions stays constant whatever ellipsoid model we use (since it all gets normalized to the unit sphere in the end anyway).
Unless I'm mistaken?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the 36843762.068421006 value, it is related to the final scale of the airocean space whose dimensions stays constant whatever ellipsoid model we use (since it all gets normalized to the unit sphere in the end anyway).

sounds surprising to me that the extent of the projection is constant and not dependent on the ellipsoid semi-major axis, but I don't know anything about that projection. I guess a could way to check that would be to add round-trip tests with the unit ellipsoid

Copy link
Author

@plouvart plouvart Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess a could way to check that would be to add round-trip tests with the unit ellipsoid

That's a good idea. I'll try that

Copy link
Author

@plouvart plouvart Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round trip tests work when the ellipsoid/no ellipsoid is the same for fwd and inv successively.
Obviously choosing a different ellipsoid model for the fwd and inv model result in a difference.

The dimensions of the Airocean space are determined by the length of the edges of the triangle faces of the icosahedron, which depends on the arbitrary choice of the radius of the sphere it is circumscribed within.
The choice was made to have that scaling factor equals the arithmetic mean radius of the earth, ie. 6,371,008.8 meters.

So it does not mater what ellipsoid model was chosen in the end, because whatever the model chosen, it always gets normalized to a unit sphere as an intermediary step before being scaled to that arbitrary dimension.

Copy link
Author

@plouvart plouvart Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Here's a small sketch I drew to illustrate my point.
blue process is a fwd/inv with +ellps=sphere and red process is fwd/inv with +ellps=GRS80 for instance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still believe there's something wrong related to taking into account ellipsoid characteristics. The value of scale factors compared to other projections seems to be totally off:

$ echo 2 49 | bin/proj +proj=merc -S 
222638.98	6242596.00	<1.52134 1.52134 2.31449 0 1.52134 1.52134>

$ echo 2 49 | bin/proj +proj=tmerc -S 
146339.48	5431555.61	<1.00026 1.00026 1.00053 0 1.00026 1.00026>

 echo 2 49 | bin/proj +proj=s2 -S 
0.53	1.05	<0.823654 1.0871 0.895218 15.8914 1.08739 0.823271>

$ echo 2 49 | bin/proj +proj=airocean -S 
13269980.92	20976603.56	<5.70685e+06 6.08587e+06 3.46329e+13 5.67366 6.18381e+06 5.60058e+06>

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

Successfully merging this pull request may close these issues.

Add Dymaxion/Fuller Projection
3 participants