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

the Bertin 1953 projection #1133

Merged
merged 5 commits into from
Oct 11, 2018
Merged

the Bertin 1953 projection #1133

merged 5 commits into from
Oct 11, 2018

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Sep 21, 2018

closes #1120

Copy link
Member

@kbevers kbevers left a 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:

  1. We need tests.
  2. 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 :-)

src/PJ_bertin1953.c Outdated Show resolved Hide resolved
src/PJ_bertin1953.c Outdated Show resolved Hide resolved
src/PJ_bertin1953.c Outdated Show resolved Hide resolved
src/PJ_bertin1953.c Outdated Show resolved Hide resolved
src/PJ_bertin1953.c Outdated Show resolved Hide resolved
Further reading
################################################################################

#. Philippe Rivière (2017). `Bertin Projection (1953) <https://visionscarto.net/bertin-projection-1953>`, Visionscarto.net.
Copy link
Member

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.

Copy link
Contributor Author

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.)

Copy link
Member

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.

Copy link
Contributor Author

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).

docs/source/operations/projections/bertin1953.rst Outdated Show resolved Hide resolved
phi -= 0.8 * d * sin(phi + M_PI / 2.);
}

/* Project with Hammer (1.68,2) */
Copy link
Member

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.

Copy link
Contributor Author

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/

Copy link
Member

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.:

/~https://github.com/OSGeo/proj.4/blob/0b32b840d3161c64d8f1f487b153178528c8c124/src/PJ_deformation.c#L270-L272

/~https://github.com/OSGeo/proj.4/blob/0b32b840d3161c64d8f1f487b153178528c8c124/src/PJ_deformation.c#L89

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.

Copy link
Contributor Author

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 :-)

docs/source/operations/projections/bertin1953.rst Outdated Show resolved Hide resolved
@kbevers kbevers added this to the 6.0.0 milestone Oct 11, 2018
@kbevers kbevers merged commit 249588a into OSGeo:master Oct 11, 2018
@Fil Fil deleted the bertin1953 branch October 12, 2018 17:10
@Fil
Copy link
Contributor Author

Fil commented Oct 12, 2018

thank you!

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 Bertin1953 projection
2 participants