aboutsummaryrefslogtreecommitdiff
path: root/src/projections
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-09-27 19:43:46 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-09-27 19:43:46 +0200
commit713a5ad61bb47cf254d930fcfc90df2e2bd24925 (patch)
tree89e9f0c28233a0be1b3f54ea27e6abb6ff890e75 /src/projections
parent485509f3b3f5133f0bb0db5ef63e932615fa2f2e (diff)
downloadPROJ-713a5ad61bb47cf254d930fcfc90df2e2bd24925.tar.gz
PROJ-713a5ad61bb47cf254d930fcfc90df2e2bd24925.zip
tmerc: setup_exact(): do not recompute third flattening already available as P->n
Diffstat (limited to 'src/projections')
-rw-r--r--src/projections/tmerc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/projections/tmerc.cpp b/src/projections/tmerc.cpp
index 0c567e13..69f4d352 100644
--- a/src/projections/tmerc.cpp
+++ b/src/projections/tmerc.cpp
@@ -489,16 +489,13 @@ static PJ_LP exact_e_inv (PJ_XY xy, PJ *P) {
}
static PJ *setup_exact(PJ *P) {
- double f, n, np, Z;
auto *Q = &(static_cast<struct tmerc_data*>(P->opaque)->exact);
assert( P->es > 0 );
- /* flattening */
- f = P->es / (1 + sqrt (1 - P->es)); /* Replaces: f = 1 - sqrt(1-P->es); */
-
/* third flattening */
- np = n = f/(2 - f);
+ const double n = P->n;
+ double np = n;
/* COEF. OF TRIG SERIES GEO <-> GAUSS */
/* cgb := Gaussian -> Geodetic, KW p190 - 191 (61) - (62) */
@@ -563,7 +560,7 @@ static PJ *setup_exact(PJ *P) {
Q->gtu[5] = np*(212378941/319334400.0);
/* Gaussian latitude value of the origin latitude */
- Z = gatg (Q->cbg, PROJ_ETMERC_ORDER, P->phi0, cos(2*P->phi0), sin(2*P->phi0));
+ const double Z = gatg (Q->cbg, PROJ_ETMERC_ORDER, P->phi0, cos(2*P->phi0), sin(2*P->phi0));
/* Origin northing minus true northing at the origin latitude */
/* i.e. true northing = N - P->Zb */