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

Correct calculation of meridian convergence for non-conformal projections #527

Merged
merged 2 commits into from
Jul 5, 2017

Conversation

kbevers
Copy link
Member

@kbevers kbevers commented Jun 21, 2017

Resolves #526

src/pj_factors.c Outdated
@@ -72,7 +72,7 @@ int pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) {

/* convergence */
if (!(fac->code & IS_ANAL_CONV)) {
fac->conv = - atan2(fac->der.y_l, fac->der.x_l);
fac->conv = - atan2(fac->der.x_p, fac->der.y_p);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why I'm looking at that as I've absolutely no background on this :-) , but this change looks surprising since atan2 arguments are documented to be in y,x order.

Copy link
Member Author

Choose a reason for hiding this comment

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

My knowledge on this is also limited, just wanted to test it out. @dtutic can you elaborate a bit on this?

Copy link

Choose a reason for hiding this comment

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

Please find attached the discussion and equations for meridian convergence.
Meridian convergence in map projections.pdf
.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I think I get it now. I guess this implies a change in convention? Are the old an new calculations equivalent for conformal projections? In that case I think it is safe to merge. If not, we should consider adding this as a seperate derivative measure of coordinates.

Did you write this your self? Can we include it in the documentation?

Copy link

Choose a reason for hiding this comment

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

I write it myself with a help of colleague who is a mathematician. You can include it in documentation, but it can be shortened or expanded depending on the purpose of documentation. The definition of meridian convergence is taken from [https://www.ngs.noaa.gov/CORS/Articles/SolerFuryASCE.pdf] , which is again taken from Geodetic Glossary by National Geodetic Survey (U.S.). The derivation of equations is an application of mathematical analysis, and it can be written in even simpler form.

The convention is the same (positive when meridian is west of grid north) , and calculations are same for conformal projections because the partial derivatives are also corrected to all have same sign convention which was not the case before, and was a reason for extra minus in previous formula.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Both for taking time to explain and for letting us use your text in the docs.

@kbevers
Copy link
Member Author

kbevers commented Jun 23, 2017

I am now convinced that this is a good idea to merge. I would like a second opinion though, just to be on the safe side. @busstoptaktik, @cffk ?

@cffk
Copy link
Contributor

cffk commented Jun 23, 2017

My preferred "definition" of meridian convergence is that it is the
bearing of grid north given as degrees clockwise (the "conventional"
sense) from true north. This is consistent with @dtutic's definition.
Needless to say, it's always a good idea to do sanity checks measuring
the meridian convergence by computing the forward (resp. reverse)
projection of two points on the same meridian (resp. on x = const).

@dtutic
Copy link

dtutic commented Jun 23, 2017

Equation for meridian convergence in LCC projection seems to give correct sign only when standard parallels are on south hemisphere. I guess that the reason is that Q->n is always positive between 0 and 1 (ratio of angle between meridians in projection and on sphere/ellipsoid).

It is now calculated in PJ_lcc.c with:
fac->conv = - Q->n * lp.lam;

It should change sign depending on standard parallels, easy to see when changing standard parallel on this animation (http://www.kartografija.hr/tl_files/konusne_final_en.xml). I will try to figure it out. There is already and issue reporting this problem https://github.com/OSGeo/proj.4/issues/16

@kbevers
Copy link
Member Author

kbevers commented Jul 5, 2017

@dtutic have you had a chance to look at the meridian convergence problem in LCC?

@dtutic
Copy link

dtutic commented Jul 5, 2017 via email

@kbevers
Copy link
Member Author

kbevers commented Jul 5, 2017

Not yet. Hope to do it by end of the next week.

Okay, then I'll merge this one now. You are welcome to add your findings to the existing ticket (#16) when you've had a closer look. Thanks for your help.

@kbevers kbevers merged commit ced55e8 into OSGeo:master Jul 5, 2017
@kbevers kbevers added this to the 4.9.4 milestone Jul 5, 2017
@kbevers kbevers deleted the issue-526 branch October 4, 2017 14:52
@kbevers kbevers modified the milestones: 5.0.0-b, 5.0.0 Feb 1, 2018
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.

4 participants