-
Notifications
You must be signed in to change notification settings - Fork 802
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
the Bertin 1953 projection #1133
Conversation
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.
Thanks for opening this PR.
I have added some inline comments which I think will improve the quality of this PR. In addition I a few general comments/changes I'd like to see before this gets merged:
- We need tests.
- I'd prefer if the code didn't use camelCase variable names. Generally speaking (there are exceptions), PROJ uses snake_case.
I would like to see a more formal mathematical description of this projection. As I understand it, the projection is basically the Hammer projected subjected to a rotation and some inital warping. I'd be interested to see if we couldn't to the same thing by constructing a pipeline of some more basic operations. This is just me thinking aloud, not something that should be pursued in this PR :-)
Further reading | ||
################################################################################ | ||
|
||
#. Philippe Rivière (2017). `Bertin Projection (1953) <https://visionscarto.net/bertin-projection-1953>`, Visionscarto.net. |
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.
Is this the best reference we have? If possible, I'd like to have a reference to the mathematical description as well, preferably an academic paper.
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.
Well if you read that modest blog post, you'll know :)
(I wish I had time and resources to publish this as an academic paper.)
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 did, but it wasn't clear to me if something else was published.
You are welcome to use the PROJ docs as a platform for describing the mathematics behind the projection.
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.
PS: I agree that my construction is totally ad-hoc, and that another formula might be much nicer mathematically (esp. with second and third derivatives). It's the best I could come up with as a first approximation, and I'm very open to making an upgraded formula at some point (provided it still respects the original drawing).
phi -= 0.8 * d * sin(phi + M_PI / 2.); | ||
} | ||
|
||
/* Project with Hammer (1.68,2) */ |
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.
So this is the same Hammer projection as defined in PJ_hammer.c
, yes? Why not use that directly by instantiating a Hammer specific PJ
object with Q->P_hammer = proj_create(P->ctx, '+proj=hammer ...')
in the projection setup and call pj_fwd(Q->P_hammer, lp)
here?
This avoids duplicate code and potential bugs in Hammer will be fixed both places if necessary.
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.
Yes I wanted to do that, but couldn't find an example in the src/
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.
Something similar is done in PJ_deformationc.
:
You'll have to adjust it a bit but the general idea is there. Also notice that you need to create a custom descructor for the PJ
object. There's an example for that in the same file as well.
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.
Feel free to add this! It's my first contribution to Proj.4 and it had been a looong time since I coded anything in C :-)
- classification - tests - coding style
thank you! |
closes #1120