Equations for meridian convergence and partial derivatives reviewed (corrected) #526

Closed
opened this Issue Jun 20, 2017 · 1 comment

Projects
2 participants

dtutic commented Jun 20, 2017 • edited

 I have found strange results for meridian convergence in non-conformal projections. As we know from map projection books (with Gauss-Bomford convention for convergence), meridian convergence should be calculated by formula fac->conv = - atan2(fac->der.x_p , fac->der.y_p). Current formula used in Proj4 is fac->conv = - atan2(fac->der.y_l , fac->der.x_l), which can be useful only for conformal projections (due to Cauchy-Riemann equations), and in fact should be without minus sign, i.e. fac->conv = atan2(fac->der.y_l , fac->der.x_l). For non-conformal projections we now get angle between parallel and x-axis, instead of meridian convergence. Minus sign currently used in formula comes from fact that fac->der.x_p and fac->der.y_l are calculated with opposite signs. Corrected equations are: File: pj_deriv.c Line 14 instead of: der->x_l = t.x; der->y_p = t.y; der->x_p = -t.x; der->y_l = -t.y; should be: der->x_l = t.x; der->y_p = t.y; der->x_p = t.x; der->y_l = t.y; Line 19 instead of: der->x_l += t.x; der->y_p -= t.y; der->x_p += t.x; der->y_l -= t.y; should be: der->x_l += t.x; der->y_p -= t.y; der->x_p -= t.x; der->y_l += t.y; Line 23 instead of: der->x_l -= t.x; der->y_p -= t.y; der->x_p += t.x; der->y_l += t.y; should be: der->x_l -= t.x; der->y_p -= t.y; der->x_p -= t.x; der->y_l -= t.y; Line 27 instead of: der->x_l -= t.x; der->y_p += t.y; der->x_p -= t.x; der->y_l += t.y; should be: der->x_l -= t.x; der->y_p += t.y; der->x_p += t.x; der->y_l -= t.y; File: pj_factors.c Line 72 instead of: fac->conv = - atan2(fac->der.y_l, fac->der.x_l); should be: fac->conv = - atan2(fac->der.x_p, fac->der.y_p); One can question the practical use of meridian convergence in non-conformal projections, but nevertheless, it would be nice to have it calculated correctly.

kbevers added a commit to kbevers/proj.4 that referenced this issue Jun 21, 2017

``` Correct calculation of meridian convergence for non-conformal project… ```
`…ions. Fixes OSGeo#526.`
``` 1e8e527 ```

Merged

Member

kbevers commented Jun 21, 2017

 I am not able to comment on the details of this without researching a bit first, but at least it sounds sensible. I have created a pull request with your changes in #527. I have reformatted the code as well. Please check that the changes are equivalent to your suggestion.

Open