diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-05-26 15:49:03 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-05-28 13:51:28 +0200 |
| commit | 48b3bd9afe0ffccf06b2c8dceef1b636834ba876 (patch) | |
| tree | 6c498328a8fa11cd50ba0b3c794c4d28796ffe17 /src/projections/wink2.cpp | |
| parent | 172744361c83d2a40c11600a398a0e1668052031 (diff) | |
| download | PROJ-48b3bd9afe0ffccf06b2c8dceef1b636834ba876.tar.gz PROJ-48b3bd9afe0ffccf06b2c8dceef1b636834ba876.zip | |
Implement wink2 inverse by generic inversion of forward method
- Move the generic method initiated from adams_ws2 to a
pj_generic_inverse_2d() method
- Use it in adams_ws2
- Use it in wink2
Fixes https://github.com/qgis/QGIS/issues/35512
Diffstat (limited to 'src/projections/wink2.cpp')
| -rw-r--r-- | src/projections/wink2.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/projections/wink2.cpp b/src/projections/wink2.cpp index 7fd08649..d457f842 100644 --- a/src/projections/wink2.cpp +++ b/src/projections/wink2.cpp @@ -6,7 +6,7 @@ #include "proj.h" #include "proj_internal.h" -PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl, Sph, no inv\n\tlat_1="; +PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl, Sph\n\tlat_1="; namespace { // anonymous namespace struct pj_opaque { @@ -41,6 +41,16 @@ static PJ_XY wink2_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forwar return xy; } +static PJ_LP wink2_s_inverse(PJ_XY xy, PJ *P) +{ + PJ_LP lpInit; + + lpInit.phi = xy.y; + lpInit.lam = xy.x; + + return pj_generic_inverse_2d(xy, P, lpInit); +} + PJ *PROJECTION(wink2) { struct pj_opaque *Q = static_cast<struct pj_opaque*>(pj_calloc (1, sizeof (struct pj_opaque))); @@ -50,8 +60,8 @@ PJ *PROJECTION(wink2) { static_cast<struct pj_opaque*>(P->opaque)->cosphi1 = cos(pj_param(P->ctx, P->params, "rlat_1").f); P->es = 0.; - P->inv = nullptr; P->fwd = wink2_s_forward; + P->inv = wink2_s_inverse; return P; } |
