aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-03-09 13:25:40 +0100
committerGitHub <noreply@github.com>2018-03-09 13:25:40 +0100
commitbae75e312ce5c6e2f0ed1c250b025ee9422b36b4 (patch)
tree05e113fed411a7c6c62d334fe0239e4b2e3d53f8 /src
parent43edec76153f8dc345c49786a3ccb122e34cadaf (diff)
parent4aea3ed17b05be61298bd8bd9d2943462e4ba649 (diff)
downloadPROJ-bae75e312ce5c6e2f0ed1c250b025ee9422b36b4.tar.gz
PROJ-bae75e312ce5c6e2f0ed1c250b025ee9422b36b4.zip
Merge pull request #844 from kbevers/tidy-proj_trans
Use consistent names for PJ_COORD's in declarations
Diffstat (limited to 'src')
-rw-r--r--src/proj.h4
-rw-r--r--src/proj_4D_api.c30
-rw-r--r--src/proj_internal.h2
3 files changed, 17 insertions, 19 deletions
diff --git a/src/proj.h b/src/proj.h
index 133f1412..4da78351 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -324,7 +324,7 @@ size_t proj_trans_generic (
PJ_COORD proj_coord (double x, double y, double z, double t);
/* Measure internal consistency - in forward or inverse direction */
-double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coo);
+double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord);
/* Geodesic distance between two points with angular 2D coordinates */
double proj_lp_dist (const PJ *P, PJ_COORD a, PJ_COORD b);
@@ -373,7 +373,7 @@ double proj_torad (double angle_in_degrees);
double proj_todeg (double angle_in_radians);
/* Geographical to geocentric latitude - another of the "simple, but useful" */
-PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coo);
+PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coord);
double proj_dmstor(const char *is, char **rs);
char* proj_rtodms(char *s, double r, int pos, int neg);
diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c
index fb20978b..f0ea7083 100644
--- a/src/proj_4D_api.c
+++ b/src/proj_4D_api.c
@@ -113,7 +113,7 @@ double proj_xyz_dist (PJ_COORD a, PJ_COORD b) {
/* Measure numerical deviation after n roundtrips fwd-inv (or inv-fwd) */
-double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coo) {
+double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord) {
int i;
PJ_COORD t, org;
@@ -126,9 +126,9 @@ double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coo) {
}
/* in the first half-step, we generate the output value */
- org = *coo;
- *coo = proj_trans (P, direction, org);
- t = *coo;
+ org = *coord;
+ *coord = proj_trans (P, direction, org);
+ t = *coord;
/* now we take n-1 full steps in inverse direction: We are */
/* out of phase due to the half step already taken */
@@ -148,26 +148,26 @@ double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coo) {
/**************************************************************************************/
-PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coo) {
+PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coord) {
/***************************************************************************************
-Apply the transformation P to the coordinate coo, preferring the 4D interfaces if
+Apply the transformation P to the coordinate coord, preferring the 4D interfaces if
available.
See also pj_approx_2D_trans and pj_approx_3D_trans in pj_internal.c, which work
similarly, but prefers the 2D resp. 3D interfaces if available.
***************************************************************************************/
if (0==P)
- return coo;
+ return coord;
if (P->inverted)
direction = -direction;
switch (direction) {
case PJ_FWD:
- return pj_fwd4d (coo, P);
+ return pj_fwd4d (coord, P);
case PJ_INV:
- return pj_inv4d (coo, P);
+ return pj_inv4d (coord, P);
case PJ_IDENT:
- return coo;
+ return coord;
default:
break;
}
@@ -357,7 +357,7 @@ size_t proj_trans_generic (
/*************************************************************************************/
-PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coo) {
+PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD coord) {
/**************************************************************************************
Convert geographical latitude to geocentric (or the other way round if
direction = PJ_INV)
@@ -373,13 +373,13 @@ PJ_COORD proj_geocentric_latitude (const PJ *P, PJ_DIRECTION direction, PJ_COORD
consequently, the input is copied directly to the output.
**************************************************************************************/
const double limit = M_HALFPI - 1e-9;
- PJ_COORD res = coo;
- if ((coo.lp.phi > limit) || (coo.lp.phi < -limit) || (P->es==0))
+ PJ_COORD res = coord;
+ if ((coord.lp.phi > limit) || (coord.lp.phi < -limit) || (P->es==0))
return res;
if (direction==PJ_FWD)
- res.lp.phi = atan (P->one_es * tan (coo.lp.phi) );
+ res.lp.phi = atan (P->one_es * tan (coord.lp.phi) );
else
- res.lp.phi = atan (P->rone_es * tan (coo.lp.phi) );
+ res.lp.phi = atan (P->rone_es * tan (coord.lp.phi) );
return res;
}
diff --git a/src/proj_internal.h b/src/proj_internal.h
index 020d0486..e72ce578 100644
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -73,8 +73,6 @@ enum pj_io_units {
enum pj_io_units pj_left (PJ *P);
enum pj_io_units pj_right (PJ *P);
-PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD obs);
-
PJ_COORD proj_coord_error (void);
void proj_context_errno_set (PJ_CONTEXT *ctx, int err);