-
Notifications
You must be signed in to change notification settings - Fork 782
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 square conformal projections from libproject #2148
Conversation
05496a2
to
cb32a5d
Compare
I see that Should these projection names be |
That's a good question. Consistency is probably better than libproject compatibility (don't think it was ever used much). |
cb32a5d
to
472712e
Compare
This is great stuff, nice work @kbevers! |
Looking at https://raw.githubusercontent.com/Esri/projection-engine-db-doc/master/csv/pe_list_projcs.csv, one can see the following:
So Esri has added an explicit XY_Plane_Rotation parameter, that they set to 0 for the WGS_1984_Adams_Square_II, and to 45 for Spilhaus. |
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 do not have much to contribute, but a few "speeling missteaks" is probably also worth correcting...
The Adams square II is actually subject to a 45 rotation as seen here: PROJ/src/projections/adams.cpp Lines 174 to 178 in 472712e
So for the Spilhaus perhaps this should just be a 90 degree rotation? Or 0? Not sure of the direction here... But yeah, a generic rotation parameter would also work. Are you aware of other cases where a parameter like that is used by Esri or others? |
Hum, I'm not sure. A possibility would be that xy_rot=0 would skip the current rotation (if that's what Esri WGS_1984_Adams_Square_II does ?), and xy_rot=45 should apply it (Spilhaus use case ?). Would be good if someone could check against a Esri install (I don't have one) what they get for the above 2 definitions (and possibly modify the base WGS_1984_Adams_Square_II one, to just test different values of the rotation parameter), so we are consistent with what they do.
Digging into Esri public repo of definitions, I see that they use it at least for Krovak (where it can be 0 or 90, as long as X_Scale and Y_Scale to apply axis reversal) and Oblique Mercator (where it maps to PROJ +gamma parameter) |
Can you clarify exactly what you're after? I can test tomorrow |
For example, take a world map (Natural Earth or whatever) and reproject it to ESRI:54098 "WGS_1984_Adams_Square_II" and ESRI:54099 "WGS_1984_Spilhaus_Ocean_Map_in_Square" And if that's possible test reprojecting to the following custom variations
|
88a7441
to
8a5c49a
Compare
I think this PR is more or less finished now. Thanks for all the input, it's been super helpful! |
It refuses to import either of these custom WKT strings |
This commit adds five new projections to PROJ: adams_hemi: Adams Hemisphere in a Square adams_wsI: Adams World in a Square I adams_wsII: Adams World in a Square II guyou: Guyou peirce_q: Pierce Quincuncial The code originates from Gerry Evendens libproject and has been adapted to work with modern PROJ. To ensure that the modified code works as intended extensive test data has been created using libproject and sproj so that no errors occured when porting from libproject to PROJ. The test data is wrapped in a gie files. All test cases reproduce results from libproject at the mm level.
8a5c49a
to
e4bf822
Compare
@nyalldawson OK, so comparing images, at least for ESRI:54098 "WGS_1984_Adams_Square_II", with XY_Plane_Rotation=0, they do apply the 45° final rotation that PROJ also applies. Thus XY_Plane_Rotation must be an extra rotation on top of that. Interesting that it refuses to import custom WKT with other XY_Plane_Rotation values. Smells like only ESRI:54098 and ESRI:54099 cases have been somehow hardcoded. |
@rouault there's always a chance I was importing wrong. There's zero documentation for this and no error messages - just no result after the import. ESRI documentation is just plain woeful. |
…jections from libproject Reflect incorporation into PROJ 7.1dev of libproject's square conformal projections per OSGeo/PROJ#2148
This PR adds five new projections to PROJ:
adams_hemi
: Adams Hemisphere in a Squareadams_ws1
: Adams World in a Square Iadams_ws2
: Adams World in a Square IIguyou
: Guyoupeirce_q
: Pierce QuincuncialThe code originates from Gerry Evendens libproject and has been adapted
to work with modern PROJ. To ensure that the modified code works as
intended extensive test data has been created using libproject and
sproj to ensure that no errors occured when porting from libproject to PROJ.
The test data is wrapped in a gie files. All test cases reproduce
results from libproject at the mm level.
Docs are still missing at this point. Will be added before merging.
This work is a first step towards implementing the Spilhaus projection as requested in #1851.
docs/source/*.rst
for new API