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 Spilhaus projection #4401

Merged
merged 2 commits into from
Feb 19, 2025
Merged

Add Spilhaus projection #4401

merged 2 commits into from
Feb 19, 2025

Conversation

jjimenezshaw
Copy link
Contributor

Implementation of the Spilhaus projection, following most of the recommendations done in #1851.
spilhaus

It is working for both the sphere and the ellipsoid. To support the ellipsoid it uses conformal latitudes.
An additional correction factor for the conformal latitude is included, that was not present in other implementations.

In ticket #1851 there was a discussion about the implementation in ESRI products, and the scale factor (apparently sqrt(2)) between both implementations. In case we want to do something else, please add a comment here. There is a CRS that uses it: ESRI:54099

  • Closes Spilhaus projection #1851
  • Tests added
  • Added clear title that can be used to generate release notes
  • Fully documented, including updating docs/source/*.rst for new API

@jjimenezshaw
Copy link
Contributor Author

Before merging this PR I have to squash the commits (and probably address the comments).

Copy link
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

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

Great work !

PJ *adams_ws2;
};

double conformal_lat(double lat, double e) {
Copy link
Member

Choose a reason for hiding this comment

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

could we move that do a dedicated file in src/ ? (if it is not already there, but can't spot it)
I can see that mod_ster_setup() does this computation too and could be another user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Is there already a file with that kind of things, or better to a dedicated one?

Copy link
Member

Choose a reason for hiding this comment

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

Probably a dedicated one. We have some files phi2.cpp, mlfn.cpp, msfn.cpp, qsfn.cpp, tsfn.cpp with "similar" things but whose naming is apparently meant to be obscure enough that I never know what they do...
Or maybe have a "latitudes.cpp" file where we would group together code to transform between geographic latitude and all those "other latitudes ? But that may be work for another pull request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created latitudes.cpp, and move the functions there.

@rouault rouault added this to the 9.6.0 milestone Feb 16, 2025
Copy link
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

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

@rouault rouault merged commit 85e7d8e into OSGeo:master Feb 19, 2025
25 of 26 checks passed
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.

Spilhaus projection
2 participants