-
Notifications
You must be signed in to change notification settings - Fork 814
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
Add Spilhaus projection #4401
Conversation
Before merging this PR I have to squash the commits (and probably address the comments). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work !
src/projections/spilhaus.cpp
Outdated
PJ *adams_ws2; | ||
}; | ||
|
||
double conformal_lat(double lat, double e) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b24d990
to
05f6183
Compare
Implementation of the Spilhaus projection, following most of the recommendations done in #1851.

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:54099docs/source/*.rst
for new API