aboutsummaryrefslogtreecommitdiff
path: root/src/projections
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2018-12-31 11:37:51 +0100
committerGitHub <noreply@github.com>2018-12-31 11:37:51 +0100
commit32f3ef47e55c38b0eabb6d781fee3944d3239414 (patch)
treeba2850500ee732559bada055dbab281ceff49a22 /src/projections
parent5c41d3a1078895ed096b416db15c91108bccad87 (diff)
parent0e0e0e475414ddeb75e0e140d8a3381a431036d9 (diff)
downloadPROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.tar.gz
PROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.zip
Merge pull request #1208 from rouault/merge_PJ_and_PJ_OBJ
Unify PJ_OBJ and PJ structures
Diffstat (limited to 'src/projections')
-rw-r--r--src/projections/aea.cpp10
-rw-r--r--src/projections/aeqd.cpp26
-rw-r--r--src/projections/airy.cpp6
-rw-r--r--src/projections/aitoff.cpp10
-rw-r--r--src/projections/august.cpp7
-rw-r--r--src/projections/bacon.cpp7
-rw-r--r--src/projections/bertin1953.cpp6
-rw-r--r--src/projections/bipc.cpp10
-rw-r--r--src/projections/boggs.cpp7
-rw-r--r--src/projections/bonne.cpp18
-rw-r--r--src/projections/calcofi.cpp18
-rw-r--r--src/projections/cass.cpp19
-rw-r--r--src/projections/cc.cpp10
-rw-r--r--src/projections/ccon.cpp10
-rw-r--r--src/projections/cea.cpp18
-rw-r--r--src/projections/chamb.cpp10
-rw-r--r--src/projections/collg.cpp10
-rw-r--r--src/projections/comill.cpp11
-rw-r--r--src/projections/crast.cpp11
-rw-r--r--src/projections/denoy.cpp7
-rw-r--r--src/projections/eck1.cpp11
-rw-r--r--src/projections/eck2.cpp10
-rw-r--r--src/projections/eck3.cpp11
-rw-r--r--src/projections/eck4.cpp11
-rw-r--r--src/projections/eck5.cpp11
-rw-r--r--src/projections/eqc.cpp10
-rw-r--r--src/projections/eqdc.cpp10
-rw-r--r--src/projections/eqearth.cpp11
-rw-r--r--src/projections/etmerc.cpp10
-rw-r--r--src/projections/fahey.cpp11
-rw-r--r--src/projections/fouc_s.cpp10
-rw-r--r--src/projections/gall.cpp11
-rw-r--r--src/projections/geos.cpp18
-rw-r--r--src/projections/gins8.cpp8
-rw-r--r--src/projections/gn_sinu.cpp18
-rw-r--r--src/projections/gnom.cpp10
-rw-r--r--src/projections/goode.cpp10
-rw-r--r--src/projections/gstmerc.cpp11
-rw-r--r--src/projections/hammer.cpp10
-rw-r--r--src/projections/hatano.cpp10
-rw-r--r--src/projections/healpix.cpp76
-rw-r--r--src/projections/igh.cpp15
-rw-r--r--src/projections/imw_p.cpp16
-rw-r--r--src/projections/isea.cpp6
-rw-r--r--src/projections/krovak.cpp11
-rw-r--r--src/projections/labrd.cpp11
-rw-r--r--src/projections/laea.cpp18
-rw-r--r--src/projections/lagrng.cpp10
-rw-r--r--src/projections/larr.cpp7
-rw-r--r--src/projections/lask.cpp8
-rw-r--r--src/projections/latlong.cpp18
-rw-r--r--src/projections/lcc.cpp10
-rw-r--r--src/projections/lcca.cpp10
-rw-r--r--src/projections/loxim.cpp10
-rw-r--r--src/projections/lsat.cpp10
-rw-r--r--src/projections/mbt_fps.cpp11
-rw-r--r--src/projections/mbtfpp.cpp10
-rw-r--r--src/projections/mbtfpq.cpp10
-rw-r--r--src/projections/merc.cpp18
-rw-r--r--src/projections/mill.cpp11
-rw-r--r--src/projections/misrsom.cpp10
-rw-r--r--src/projections/mod_ster.cpp11
-rw-r--r--src/projections/moll.cpp11
-rw-r--r--src/projections/natearth.cpp11
-rw-r--r--src/projections/natearth2.cpp11
-rw-r--r--src/projections/nell.cpp11
-rw-r--r--src/projections/nell_h.cpp11
-rw-r--r--src/projections/nicol.cpp7
-rw-r--r--src/projections/nsper.cpp10
-rw-r--r--src/projections/nzmg.cpp11
-rw-r--r--src/projections/ob_tran.cpp14
-rw-r--r--src/projections/ocea.cpp11
-rw-r--r--src/projections/oea.cpp10
-rw-r--r--src/projections/omerc.cpp10
-rw-r--r--src/projections/ortho.cpp12
-rw-r--r--src/projections/patterson.cpp11
-rw-r--r--src/projections/poly.cpp18
-rw-r--r--src/projections/putp2.cpp11
-rw-r--r--src/projections/putp3.cpp12
-rw-r--r--src/projections/putp4p.cpp11
-rw-r--r--src/projections/putp5.cpp11
-rw-r--r--src/projections/putp6.cpp11
-rw-r--r--src/projections/qsc.cpp11
-rw-r--r--src/projections/robin.cpp10
-rw-r--r--src/projections/rouss.cpp10
-rw-r--r--src/projections/rpoly.cpp7
-rw-r--r--src/projections/sch.cpp10
-rw-r--r--src/projections/sconics.cpp10
-rw-r--r--src/projections/somerc.cpp10
-rw-r--r--src/projections/stere.cpp18
-rw-r--r--src/projections/sterea.cpp11
-rw-r--r--src/projections/sts.cpp11
-rw-r--r--src/projections/tcc.cpp6
-rw-r--r--src/projections/tcea.cpp11
-rw-r--r--src/projections/times.cpp11
-rw-r--r--src/projections/tmerc.cpp18
-rw-r--r--src/projections/tobmerc.cpp10
-rw-r--r--src/projections/tpeqd.cpp10
-rw-r--r--src/projections/urm5.cpp6
-rw-r--r--src/projections/urmfps.cpp10
-rw-r--r--src/projections/vandg.cpp10
-rw-r--r--src/projections/vandg2.cpp7
-rw-r--r--src/projections/vandg4.cpp7
-rw-r--r--src/projections/wag2.cpp11
-rw-r--r--src/projections/wag3.cpp11
-rw-r--r--src/projections/wag7.cpp7
-rw-r--r--src/projections/wink1.cpp11
-rw-r--r--src/projections/wink2.cpp7
108 files changed, 655 insertions, 601 deletions
diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp
index c4a4a72a..9a0c4656 100644
--- a/src/projections/aea.cpp
+++ b/src/projections/aea.cpp
@@ -30,7 +30,7 @@
#define PJ_LIB__
#include "proj.h"
#include <errno.h>
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -99,8 +99,8 @@ static PJ *destructor (PJ *P, int errlev) { /* Destructor
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoid/spheroid, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoid/spheroid, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
Q->rho = Q->c - (Q->ellips ? Q->n * pj_qsfn(sin(lp.phi), P->e, P->one_es) : Q->n2 * sin(lp.phi));;
if (Q->rho < 0.) {
@@ -114,8 +114,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoid/spheroid, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoid/spheroid, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoid/spheroid, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if( (Q->rho = hypot(xy.x, xy.y = Q->rho0 - xy.y)) != 0.0 ) {
if (Q->n < 0.) {
diff --git a/src/projections/aeqd.cpp b/src/projections/aeqd.cpp
index 1a350d90..8566062d 100644
--- a/src/projections/aeqd.cpp
+++ b/src/projections/aeqd.cpp
@@ -29,7 +29,7 @@
#include "geodesic.h"
#include "proj.h"
#include <errno.h>
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -75,8 +75,8 @@ static PJ *destructor (PJ *P, int errlev) { /* Destructor
-static XY e_guam_fwd(LP lp, PJ *P) { /* Guam elliptical */
- XY xy = {0.0,0.0};
+static PJ_XY e_guam_fwd(PJ_LP lp, PJ *P) { /* Guam elliptical */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, sinphi, t;
@@ -91,8 +91,8 @@ static XY e_guam_fwd(LP lp, PJ *P) { /* Guam elliptical */
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi, rho;
double azi1, azi2, s12;
@@ -130,8 +130,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -177,8 +177,8 @@ oblcon:
}
-static LP e_guam_inv(XY xy, PJ *P) { /* Guam elliptical */
- LP lp = {0.0,0.0};
+static PJ_LP e_guam_inv(PJ_XY xy, PJ *P) { /* Guam elliptical */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double x2, t = 0.0;
int i;
@@ -195,8 +195,8 @@ static LP e_guam_inv(XY xy, PJ *P) { /* Guam elliptical */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c;
double azi1, azi2, s12, x2, y2, lat1, lon1, lat2, lon2;
@@ -227,8 +227,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosc, c_rh, sinc;
diff --git a/src/projections/airy.cpp b/src/projections/airy.cpp
index 0eb5efd7..f7068061 100644
--- a/src/projections/airy.cpp
+++ b/src/projections/airy.cpp
@@ -29,7 +29,7 @@
#define PJ_LIB__
#include "proj.h"
#include <errno.h>
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(airy, "Airy") "\n\tMisc Sph, no inv\n\tno_cut lat_b=";
@@ -58,8 +58,8 @@ struct pj_opaque {
# define EPS 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinlam, coslam, cosphi, sinphi, t, s, Krho, cosz;
diff --git a/src/projections/aitoff.cpp b/src/projections/aitoff.cpp
index effd2c29..127841ff 100644
--- a/src/projections/aitoff.cpp
+++ b/src/projections/aitoff.cpp
@@ -34,7 +34,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
@@ -62,8 +62,8 @@ FORWARD(s_forward); /* spheroid */
#endif
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c, d;
@@ -100,8 +100,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
*
************************************************************************************/
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int iter, MAXITER = 10, round = 0, MAXROUND = 20;
double EPSILON = 1e-12, D, C, f1, f2, f1p, f1l, f2p, f2l, dp, dl, sl, sp, cp, cl, x, y;
diff --git a/src/projections/august.cpp b/src/projections/august.cpp
index b5a21ef7..3523034e 100644
--- a/src/projections/august.cpp
+++ b/src/projections/august.cpp
@@ -2,14 +2,15 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(august, "August Epicycloidal") "\n\tMisc Sph, no inv";
#define M 1.333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double t, c1, c, x1, x12, y1, y12;
(void) P;
diff --git a/src/projections/bacon.cpp b/src/projections/bacon.cpp
index 6c6350fe..c713a989 100644
--- a/src/projections/bacon.cpp
+++ b/src/projections/bacon.cpp
@@ -4,7 +4,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
@@ -19,8 +20,8 @@ PROJ_HEAD(ortel, "Ortelius Oval") "\n\tMisc Sph, no inv";
PROJ_HEAD(bacon, "Bacon Globular") "\n\tMisc Sph, no inv";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double ax, f;
diff --git a/src/projections/bertin1953.cpp b/src/projections/bertin1953.cpp
index 2203d6f1..96de6d4b 100644
--- a/src/projections/bertin1953.cpp
+++ b/src/projections/bertin1953.cpp
@@ -16,7 +16,7 @@
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(bertin1953, "Bertin 1953")
"\n\tMisc Sph no inv.";
@@ -28,8 +28,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double fu = 1.4, k = 12., w = 1.68, d;
diff --git a/src/projections/bipc.cpp b/src/projections/bipc.cpp
index 19a6bbe1..5cfef11f 100644
--- a/src/projections/bipc.cpp
+++ b/src/projections/bipc.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(bipc, "Bipolar conic of western hemisphere") "\n\tConic Sph";
@@ -36,8 +36,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cphi, sphi, tphi, t, al, Az, z, Av, cdlam, sdlam, r;
int tag;
@@ -113,8 +113,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t, r, rp, rl, al, z = 0.0, fAz, Az, s, c, Av;
int neg, i;
diff --git a/src/projections/boggs.cpp b/src/projections/boggs.cpp
index 119357c0..5502d493 100644
--- a/src/projections/boggs.cpp
+++ b/src/projections/boggs.cpp
@@ -1,7 +1,8 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl, no inv, Sph";
# define NITER 20
@@ -11,8 +12,8 @@ PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl, no inv, Sph";
# define FYC 0.49931
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double theta, th1, c;
int i;
(void) P;
diff --git a/src/projections/bonne.cpp b/src/projections/bonne.cpp
index 385c1c4b..0e9bae79 100644
--- a/src/projections/bonne.cpp
+++ b/src/projections/bonne.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -20,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, E, c;
@@ -33,8 +33,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double E, rh;
@@ -48,8 +48,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh;
@@ -67,8 +67,8 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double s, rh;
diff --git a/src/projections/calcofi.cpp b/src/projections/calcofi.cpp
index e81e4d2a..e81843b4 100644
--- a/src/projections/calcofi.cpp
+++ b/src/projections/calcofi.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_api.h"
PROJ_HEAD(calcofi,
@@ -35,8 +35,8 @@ whatever ellipsoid is provided. */
#define ROTATION_ANGLE 0.52359877559829882 /*CalCOFI angle of 30 deg in rad */
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
double oy; /* pt O y value in Mercator */
double l1; /* l1 and l2 are distances calculated using trig that sum
to the east/west distance between point O and point xy */
@@ -67,8 +67,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double oy;
double l1;
double l2;
@@ -93,8 +93,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double ry; /* y value of point r */
double oymctr; /* Mercator-transformed y value of point O */
double rymctr; /* Mercator-transformed ry */
@@ -116,8 +116,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double ry;
double oymctr;
double rymctr;
diff --git a/src/projections/cass.cpp b/src/projections/cass.cpp
index c831558c..ee050548 100644
--- a/src/projections/cass.cpp
+++ b/src/projections/cass.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(cass, "Cassini") "\n\tCyl, Sph&Ell";
@@ -24,9 +25,9 @@ struct pj_opaque {
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
double n, t, a1, c, a2, tn;
- XY xy = {0.0, 0.0};
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = pj_mlfn (lp.phi, n = sin (lp.phi), c = cos (lp.phi), Q->en);
@@ -46,17 +47,17 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
xy.x = asin (cos (lp.phi) * sin (lp.lam));
xy.y = atan2 (tan (lp.phi), cos (lp.lam)) - P->phi0;
return xy;
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
double n, t, r, dd, d2, tn, ph1;
- LP lp = {0.0, 0.0};
+ PJ_LP lp = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
ph1 = pj_inv_mlfn (P->ctx, Q->m0 + xy.y, P->es, Q->en);
@@ -75,8 +76,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double dd;
lp.phi = asin(sin(dd = xy.y + P->phi0) * cos(xy.x));
lp.lam = atan2(tan(xy.x), cos(dd));
diff --git a/src/projections/cc.cpp b/src/projections/cc.cpp
index 152e6e4a..559a4f1a 100644
--- a/src/projections/cc.cpp
+++ b/src/projections/cc.cpp
@@ -3,14 +3,14 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph";
#define EPS10 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
if (fabs (fabs(lp.phi) - M_HALFPI) <= EPS10) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -21,8 +21,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = atan(xy.y);
lp.lam = xy.x;
diff --git a/src/projections/ccon.cpp b/src/projections/ccon.cpp
index 4f7dedb4..5f5128cf 100644
--- a/src/projections/ccon.cpp
+++ b/src/projections/ccon.cpp
@@ -23,7 +23,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
#define EPS10 1e-10
@@ -43,8 +43,8 @@ PROJ_HEAD(ccon, "Central Conic")
-static XY forward (LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+static PJ_XY forward (PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double r;
@@ -56,8 +56,8 @@ static XY forward (LP lp, PJ *P) {
}
-static LP inverse (XY xy, PJ *P) {
- LP lp = {0.0,0.0};
+static PJ_LP inverse (PJ_XY xy, PJ *P) {
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = Q->ctgphi1 - xy.y;
diff --git a/src/projections/cea.cpp b/src/projections/cea.cpp
index f8275b62..a1c9c8b5 100644
--- a/src/projections/cea.cpp
+++ b/src/projections/cea.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -17,32 +17,32 @@ PROJ_HEAD(cea, "Equal Area Cylindrical") "\n\tCyl, Sph&Ell\n\tlat_ts=";
# define EPS 1e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = P->k0 * lp.lam;
xy.y = 0.5 * pj_qsfn (sin (lp.phi), P->e, P->one_es) / P->k0;
return xy;
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = P->k0 * lp.lam;
xy.y = sin(lp.phi) / P->k0;
return xy;
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = pj_authlat(asin( 2. * xy.y * P->k0 / static_cast<struct pj_opaque*>(P->opaque)->qp), static_cast<struct pj_opaque*>(P->opaque)->apa);
lp.lam = xy.x / P->k0;
return lp;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t;
if ((t = fabs(xy.y *= P->k0)) - EPS <= 1.) {
diff --git a/src/projections/chamb.cpp b/src/projections/chamb.cpp
index a490e817..33a38781 100644
--- a/src/projections/chamb.cpp
+++ b/src/projections/chamb.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
typedef struct { double r, Az; } VECT;
namespace { // anonymous namespace
@@ -13,10 +13,10 @@ struct pj_opaque {
double phi, lam;
double cosphi, sinphi;
VECT v;
- XY p;
+ PJ_XY p;
double Az;
} c[3];
- XY p;
+ PJ_XY p;
double beta_0, beta_1, beta_2;
};
} // anonymous namespace
@@ -54,8 +54,8 @@ static double lc(projCtx ctx, double b,double c,double a) {
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinphi, cosphi, a;
VECT v[3];
diff --git a/src/projections/collg.cpp b/src/projections/collg.cpp
index 7904de29..b22e1bf2 100644
--- a/src/projections/collg.cpp
+++ b/src/projections/collg.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph";
#define FXC 1.12837916709551257390
@@ -11,8 +11,8 @@ PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph";
#define ONEEPS 1.0000001
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
if ((xy.y = 1. - sin(lp.phi)) <= 0.)
xy.y = 0.;
@@ -24,8 +24,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / FYC - 1.;
if (fabs(lp.phi = 1. - lp.phi * lp.phi) < 1.)
lp.phi = asin(lp.phi);
diff --git a/src/projections/comill.cpp b/src/projections/comill.cpp
index b6e0192e..3af19b42 100644
--- a/src/projections/comill.cpp
+++ b/src/projections/comill.cpp
@@ -10,7 +10,8 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(comill, "Compact Miller") "\n\tCyl, Sph";
@@ -25,8 +26,8 @@ PROJ_HEAD(comill, "Compact Miller") "\n\tCyl, Sph";
/* Not sure at all of the appropriate number for MAX_ITER... */
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double lat_sq;
(void) P; /* silence unused parameter warnings */
@@ -38,8 +39,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, f, fder;
int i;
diff --git a/src/projections/crast.cpp b/src/projections/crast.cpp
index 4e4dee8b..35272058 100644
--- a/src/projections/crast.cpp
+++ b/src/projections/crast.cpp
@@ -1,7 +1,8 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph";
#define THIRD 0.333333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
lp.phi *= THIRD;
xy.x = XM * lp.lam * (2. * cos(lp.phi + lp.phi) - 1.);
@@ -22,8 +23,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = 3. * asin(xy.y * RYM);
lp.lam = xy.x * RXM / (2. * cos((lp.phi + lp.phi) * THIRD) - 1);
diff --git a/src/projections/denoy.cpp b/src/projections/denoy.cpp
index 5c337c45..1560ad6b 100644
--- a/src/projections/denoy.cpp
+++ b/src/projections/denoy.cpp
@@ -1,7 +1,8 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl, no inv, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl, no inv, Sph";
#define D5 0.03
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
(void) P;
xy.y = lp.phi;
xy.x = lp.lam;
diff --git a/src/projections/eck1.cpp b/src/projections/eck1.cpp
index 88a7430c..3a19796e 100644
--- a/src/projections/eck1.cpp
+++ b/src/projections/eck1.cpp
@@ -1,15 +1,16 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl, Sph";
#define FC 0.92131773192356127802
#define RP 0.31830988618379067154
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = FC * lp.lam * (1. - RP * fabs(lp.phi));
@@ -19,8 +20,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = xy.y / FC;
diff --git a/src/projections/eck2.cpp b/src/projections/eck2.cpp
index f76ab4ec..f019fdab 100644
--- a/src/projections/eck2.cpp
+++ b/src/projections/eck2.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl, Sph";
@@ -13,8 +13,8 @@ PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl, Sph";
#define ONEEPS 1.0000001
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = FXC * lp.lam * (xy.y = sqrt(4. - 3. * sin(fabs(lp.phi))));
@@ -25,8 +25,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = xy.x / (FXC * ( lp.phi = 2. - fabs(xy.y) / FYC) );
diff --git a/src/projections/eck3.cpp b/src/projections/eck3.cpp
index 90376631..6777c765 100644
--- a/src/projections/eck3.cpp
+++ b/src/projections/eck3.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck3, "Eckert III") "\n\tPCyl, Sph";
PROJ_HEAD(putp1, "Putnins P1") "\n\tPCyl, Sph";
@@ -17,8 +18,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = Q->C_y * lp.phi;
@@ -27,8 +28,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double denominator;
diff --git a/src/projections/eck4.cpp b/src/projections/eck4.cpp
index 4fa4c21f..7f8203b2 100644
--- a/src/projections/eck4.cpp
+++ b/src/projections/eck4.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph";
@@ -15,8 +16,8 @@ PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph";
#define NITER 6
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double p, V, s, c;
int i;
(void) P;
@@ -43,8 +44,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double c;
lp.phi = aasin(P->ctx,xy.y * RC_y);
diff --git a/src/projections/eck5.cpp b/src/projections/eck5.cpp
index f9f28460..40e9d3bb 100644
--- a/src/projections/eck5.cpp
+++ b/src/projections/eck5.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph";
#define RYF 1.13375401361911319568
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = XF * (1. + cos(lp.phi)) * lp.lam;
xy.y = YF * lp.phi;
@@ -22,8 +23,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = RXF * xy.x / (1. + cos( lp.phi = RYF * xy.y));
diff --git a/src/projections/eqc.cpp b/src/projections/eqc.cpp
index 3fdb6dc0..eb021eac 100644
--- a/src/projections/eqc.cpp
+++ b/src/projections/eqc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -16,8 +16,8 @@ PROJ_HEAD(eqc, "Equidistant Cylindrical (Plate Carree)")
"\n\tCyl, Sph\n\tlat_ts=[, lat_0=0]";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.x = Q->rc * lp.lam;
@@ -27,8 +27,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.lam = xy.x / Q->rc;
diff --git a/src/projections/eqdc.cpp b/src/projections/eqdc.cpp
index 0831fca4..d175d4a1 100644
--- a/src/projections/eqdc.cpp
+++ b/src/projections/eqdc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -25,8 +25,8 @@ PROJ_HEAD(eqdc, "Equidistant Conic")
# define EPS10 1.e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
Q->rho = Q->c - (Q->ellips ? pj_mlfn(lp.phi, sin(lp.phi),
@@ -38,8 +38,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if ((Q->rho = hypot(xy.x, xy.y = Q->rho0 - xy.y)) != 0.0 ) {
diff --git a/src/projections/eqearth.cpp b/src/projections/eqearth.cpp
index e5c1f974..dc58eed9 100644
--- a/src/projections/eqearth.cpp
+++ b/src/projections/eqearth.cpp
@@ -16,7 +16,8 @@ Added ellipsoidal equations by Bojan Savric, 22 August 2018
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eqearth, "Equal Earth") "\n\tPCyl, Sph&Ell";
@@ -39,8 +40,8 @@ struct pj_opaque {
};
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal/spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal/spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sbeta;
double psi, psi2, psi6;
@@ -73,8 +74,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal/spheroidal, forwar
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal/spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal/spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double yc, y2, y6;
int i;
diff --git a/src/projections/etmerc.cpp b/src/projections/etmerc.cpp
index 05f86f37..e75bc168 100644
--- a/src/projections/etmerc.cpp
+++ b/src/projections/etmerc.cpp
@@ -43,7 +43,7 @@
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -145,8 +145,8 @@ static double clens(double *a, int size, double arg_r) {
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
double Cn = lp.phi, Ce = lp.lam;
@@ -181,8 +181,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
double Cn = xy.y, Ce = xy.x;
diff --git a/src/projections/fahey.cpp b/src/projections/fahey.cpp
index 85e0ab69..ba8cb8f9 100644
--- a/src/projections/fahey.cpp
+++ b/src/projections/fahey.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(fahey, "Fahey") "\n\tPcyl, Sph";
#define TOL 1e-6
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = tan(0.5 * lp.phi);
@@ -20,8 +21,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
xy.y /= 1.819152;
diff --git a/src/projections/fouc_s.cpp b/src/projections/fouc_s.cpp
index c5e711de..e91f41c3 100644
--- a/src/projections/fouc_s.cpp
+++ b/src/projections/fouc_s.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(fouc_s, "Foucaut Sinusoidal") "\n\tPCyl, Sph";
@@ -18,8 +18,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t;
@@ -30,8 +30,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double V;
int i;
diff --git a/src/projections/gall.cpp b/src/projections/gall.cpp
index a8697482..8f1ca1f8 100644
--- a/src/projections/gall.cpp
+++ b/src/projections/gall.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph";
#define RXF 1.41421356237309504880
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = XF * lp.lam;
@@ -23,8 +24,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = RXF * xy.x;
diff --git a/src/projections/geos.cpp b/src/projections/geos.cpp
index 90fb01ab..cdb0244a 100644
--- a/src/projections/geos.cpp
+++ b/src/projections/geos.cpp
@@ -33,7 +33,7 @@
#include <stddef.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -52,8 +52,8 @@ struct pj_opaque {
PROJ_HEAD(geos, "Geostationary Satellite View") "\n\tAzi, Sph&Ell\n\th=";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Vx, Vy, Vz, tmp;
@@ -82,8 +82,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double r, Vx, Vy, Vz, tmp;
@@ -118,8 +118,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Vx, Vy, Vz, a, b, det, k;
@@ -155,8 +155,8 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Vx, Vy, Vz, a, b, det, k;
diff --git a/src/projections/gins8.cpp b/src/projections/gins8.cpp
index cc422437..6f499889 100644
--- a/src/projections/gins8.cpp
+++ b/src/projections/gins8.cpp
@@ -1,5 +1,7 @@
#define PJ_LIB__
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph, no inv";
@@ -8,8 +10,8 @@ PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph, no inv";
#define C12 0.08333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double t = lp.phi * lp.phi;
(void) P;
diff --git a/src/projections/gn_sinu.cpp b/src/projections/gn_sinu.cpp
index 530de229..3a591669 100644
--- a/src/projections/gn_sinu.cpp
+++ b/src/projections/gn_sinu.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(gn_sinu, "General Sinusoidal Series") "\n\tPCyl, Sph\n\tm= n=";
PROJ_HEAD(sinu, "Sinusoidal (Sanson-Flamsteed)") "\n\tPCyl, Sph&Ell";
@@ -23,8 +23,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
double s, c;
xy.y = pj_mlfn(lp.phi, s = sin(lp.phi), c = cos(lp.phi), static_cast<struct pj_opaque*>(P->opaque)->en);
@@ -33,8 +33,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double s;
if ((s = fabs(lp.phi = pj_inv_mlfn(P->ctx, xy.y, P->es, static_cast<struct pj_opaque*>(P->opaque)->en))) < M_HALFPI) {
@@ -50,8 +50,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if (Q->m == 0.0)
@@ -80,8 +80,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y /= Q->C_y;
diff --git a/src/projections/gnom.cpp b/src/projections/gnom.cpp
index a4b5e35d..bf454ba9 100644
--- a/src/projections/gnom.cpp
+++ b/src/projections/gnom.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(gnom, "Gnomonic") "\n\tAzi, Sph";
@@ -29,8 +29,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -77,8 +77,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, cosz, sinz;
diff --git a/src/projections/goode.cpp b/src/projections/goode.cpp
index c79d125e..802df90c 100644
--- a/src/projections/goode.cpp
+++ b/src/projections/goode.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(goode, "Goode Homolosine") "\n\tPCyl, Sph";
@@ -21,8 +21,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if (fabs(lp.phi) <= PHI_LIM)
@@ -35,8 +35,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp;
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if (fabs(xy.y) <= PHI_LIM)
diff --git a/src/projections/gstmerc.cpp b/src/projections/gstmerc.cpp
index 9b819bac..735d39e5 100644
--- a/src/projections/gstmerc.cpp
+++ b/src/projections/gstmerc.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)")
"\n\tCyl, Sph&Ell\n\tlat_0= lon_0= k_0=";
@@ -21,8 +22,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double L, Ls, sinLs1, Ls1;
@@ -37,8 +38,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double L, LC, sinC;
diff --git a/src/projections/hammer.cpp b/src/projections/hammer.cpp
index d4caa656..aa7d1ba9 100644
--- a/src/projections/hammer.cpp
+++ b/src/projections/hammer.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
"\n\tMisc Sph, \n\tW= M=";
@@ -19,8 +19,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, d;
@@ -31,8 +31,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double z;
diff --git a/src/projections/hatano.cpp b/src/projections/hatano.cpp
index 019671cc..b2ef6c6f 100644
--- a/src/projections/hatano.cpp
+++ b/src/projections/hatano.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area") "\n\tPCyl, Sph";
@@ -22,8 +22,8 @@ PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area") "\n\tPCyl, Sph";
#define RXC 1.17647058823529411764
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double th1, c;
int i;
(void) P;
@@ -40,8 +40,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double th;
th = xy.y * ( xy.y < 0. ? RYCS : RYCN);
diff --git a/src/projections/healpix.cpp b/src/projections/healpix.cpp
index 7f0b3e83..8e4846ed 100644
--- a/src/projections/healpix.cpp
+++ b/src/projections/healpix.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
* Project: PROJ.4
- * Purpose: Implementation of the HEALPix and rHEALPix projections.
+ * Purpose: Implementation of the HEAPJ_LPix and rHEAPJ_LPix projections.
* For background see <http://code.scenzgrid.org/index.php/p/scenzgrid-py/source/tree/master/docs/rhealpix_dggs.pdf>.
* Authors: Alex Raichev (raichev@cs.auckland.ac.nz)
* Michael Speth (spethm@landcareresearch.co.nz)
@@ -35,10 +35,10 @@
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
-PROJ_HEAD(healpix, "HEALPix") "\n\tSph&Ell";
-PROJ_HEAD(rhealpix, "rHEALPix") "\n\tSph&Ell\n\tnorth_square= south_square=";
+PROJ_HEAD(healpix, "HEAPJ_LPix") "\n\tSph&Ell";
+PROJ_HEAD(rhealpix, "rHEAPJ_LPix") "\n\tSph&Ell\n\tnorth_square= south_square=";
/* Matrix for counterclockwise rotation by pi/2: */
# define R1 {{ 0,-1},{ 1, 0}}
@@ -116,7 +116,7 @@ static int pnpoly(int nvert, double vert[][2], double testx, double testy) {
int i;
int counter = 0;
double xinters;
- XY p1, p2;
+ PJ_XY p1, p2;
/* Check for boundrary cases */
for (i = 0; i < nvert; i++) {
@@ -153,10 +153,10 @@ static int pnpoly(int nvert, double vert[][2], double testx, double testy) {
/**
* Return 1 if (x, y) lies in (the interior or boundary of) the image of the
- * HEALPix projection (in case proj=0) or in the image the rHEALPix projection
+ * HEAPJ_LPix projection (in case proj=0) or in the image the rHEAPJ_LPix projection
* (in case proj=1), and return 0 otherwise.
- * @param north_square the position of the north polar square (rHEALPix only)
- * @param south_square the position of the south polar square (rHEALPix only)
+ * @param north_square the position of the north polar square (rHEAPJ_LPix only)
+ * @param south_square the position of the south polar square (rHEAPJ_LPix only)
**/
static int in_image(double x, double y, int proj, int north_square,
int south_square) {
@@ -251,14 +251,14 @@ static double auth_lat(PJ *P, double alpha, int inverse) {
/**
- * Return the HEALPix projection of the longitude-latitude point lp on
+ * Return the HEAPJ_LPix projection of the longitude-latitude point lp on
* the unit sphere.
**/
-static XY healpix_sphere(LP lp) {
+static PJ_XY healpix_sphere(PJ_LP lp) {
double lam = lp.lam;
double phi = lp.phi;
double phi0 = asin(2.0/3.0);
- XY xy;
+ PJ_XY xy;
/* equatorial region */
if ( fabs(phi) <= phi0) {
@@ -282,8 +282,8 @@ static XY healpix_sphere(LP lp) {
/**
* Return the inverse of healpix_sphere().
**/
-static LP healpix_sphere_inverse(XY xy) {
- LP lp;
+static PJ_LP healpix_sphere_inverse(PJ_XY xy) {
+ PJ_LP lp;
double x = xy.x;
double y = xy.y;
double y0 = M_FORTPI;
@@ -354,10 +354,10 @@ static void dot_product(const double a[2][2], const double b[2], double *ret) {
/**
* Return the number of the polar cap, the pole point coordinates, and
* the region that (x, y) lies in.
- * If inverse=0, then assume (x,y) lies in the image of the HEALPix
+ * If inverse=0, then assume (x,y) lies in the image of the HEAPJ_LPix
* projection of the unit sphere.
* If inverse=1, then assume (x,y) lies in the image of the
- * (north_square, south_square)-rHEALPix projection of the unit sphere.
+ * (north_square, south_square)-rHEAPJ_LPix projection of the unit sphere.
**/
static CapMap get_cap(double x, double y, int north_square, int south_square,
int inverse) {
@@ -412,8 +412,8 @@ static CapMap get_cap(double x, double y, int north_square, int south_square,
capmap.cn = 0;
return capmap;
}
- /* Polar Region, find the HEALPix polar cap number that
- x, y moves to when rHEALPix polar square is disassembled. */
+ /* Polar Region, find the HEAPJ_LPix polar cap number that
+ x, y moves to when rHEAPJ_LPix polar square is disassembled. */
if (capmap.region == CapMap::north) {
if (y >= -x - M_FORTPI - EPS && y < x + 5*M_FORTPI - EPS) {
capmap.cn = (north_square + 1) % 4;
@@ -441,7 +441,7 @@ static CapMap get_cap(double x, double y, int north_square, int south_square,
/**
- * Rearrange point (x, y) in the HEALPix projection by
+ * Rearrange point (x, y) in the HEAPJ_LPix projection by
* combining the polar caps into two polar squares.
* Put the north polar square in position north_square and
* the south polar square in position south_square.
@@ -449,9 +449,9 @@ static CapMap get_cap(double x, double y, int north_square, int south_square,
* @param north_square integer between 0 and 3.
* @param south_square integer between 0 and 3.
**/
-static XY combine_caps(double x, double y, int north_square, int south_square,
+static PJ_XY combine_caps(double x, double y, int north_square, int south_square,
int inverse) {
- XY xy;
+ PJ_XY xy;
double v[2];
double c[2];
double vector[2];
@@ -512,22 +512,22 @@ static XY combine_caps(double x, double y, int north_square, int south_square,
}
-static XY s_healpix_forward(LP lp, PJ *P) { /* sphere */
+static PJ_XY s_healpix_forward(PJ_LP lp, PJ *P) { /* sphere */
(void) P;
return healpix_sphere(lp);
}
-static XY e_healpix_forward(LP lp, PJ *P) { /* ellipsoid */
+static PJ_XY e_healpix_forward(PJ_LP lp, PJ *P) { /* ellipsoid */
lp.phi = auth_lat(P, lp.phi, 0);
return healpix_sphere(lp);
}
-static LP s_healpix_inverse(XY xy, PJ *P) { /* sphere */
- /* Check whether (x, y) lies in the HEALPix image */
+static PJ_LP s_healpix_inverse(PJ_XY xy, PJ *P) { /* sphere */
+ /* Check whether (x, y) lies in the HEAPJ_LPix image */
if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
- LP lp;
+ PJ_LP lp;
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
@@ -537,10 +537,10 @@ static LP s_healpix_inverse(XY xy, PJ *P) { /* sphere */
}
-static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
- LP lp = {0.0,0.0};
+static PJ_LP e_healpix_inverse(PJ_XY xy, PJ *P) { /* ellipsoid */
+ PJ_LP lp = {0.0,0.0};
- /* Check whether (x, y) lies in the HEALPix image. */
+ /* Check whether (x, y) lies in the HEAPJ_LPix image. */
if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
@@ -553,29 +553,29 @@ static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
}
-static XY s_rhealpix_forward(LP lp, PJ *P) { /* sphere */
+static PJ_XY s_rhealpix_forward(PJ_LP lp, PJ *P) { /* sphere */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy = healpix_sphere(lp);
+ PJ_XY xy = healpix_sphere(lp);
return combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 0);
}
-static XY e_rhealpix_forward(LP lp, PJ *P) { /* ellipsoid */
+static PJ_XY e_rhealpix_forward(PJ_LP lp, PJ *P) { /* ellipsoid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy;
+ PJ_XY xy;
lp.phi = auth_lat(P, lp.phi, 0);
xy = healpix_sphere(lp);
return combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 0);
}
-static LP s_rhealpix_inverse(XY xy, PJ *P) { /* sphere */
+static PJ_LP s_rhealpix_inverse(PJ_XY xy, PJ *P) { /* sphere */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- /* Check whether (x, y) lies in the rHEALPix image. */
+ /* Check whether (x, y) lies in the rHEAPJ_LPix image. */
if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
- LP lp;
+ PJ_LP lp;
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
@@ -586,11 +586,11 @@ static LP s_rhealpix_inverse(XY xy, PJ *P) { /* sphere */
}
-static LP e_rhealpix_inverse(XY xy, PJ *P) { /* ellipsoid */
+static PJ_LP e_rhealpix_inverse(PJ_XY xy, PJ *P) { /* ellipsoid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- LP lp = {0.0,0.0};
+ PJ_LP lp = {0.0,0.0};
- /* Check whether (x, y) lies in the rHEALPix image. */
+ /* Check whether (x, y) lies in the rHEAPJ_LPix image. */
if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
diff --git a/src/projections/igh.cpp b/src/projections/igh.cpp
index e3576861..a8efbb9d 100644
--- a/src/projections/igh.cpp
+++ b/src/projections/igh.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(igh, "Interrupted Goode Homolosine") "\n\tPCyl, Sph";
@@ -40,8 +41,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int z;
@@ -73,8 +74,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
const double y90 = Q->dy0 + sqrt(2); /* lt=90 corresponds to y=y0+sqrt(2) */
@@ -184,8 +185,8 @@ static PJ *destructor (PJ *P, int errlev) {
PJ *PROJECTION(igh) {
- XY xy1, xy3;
- LP lp = { 0, d4044118 };
+ PJ_XY xy1, xy3;
+ PJ_LP lp = { 0, d4044118 };
struct pj_opaque *Q = static_cast<struct pj_opaque*>(pj_calloc (1, sizeof (struct pj_opaque)));
if (nullptr==Q)
return pj_default_destructor (P, ENOMEM);
diff --git a/src/projections/imw_p.cpp b/src/projections/imw_p.cpp
index 012c5caa..723fcc48 100644
--- a/src/projections/imw_p.cpp
+++ b/src/projections/imw_p.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(imw_p, "International Map of the World Polyconic")
"\n\tMod. Polyconic, Ell\n\tlat_1= and lat_2= [lon_1=]";
@@ -48,9 +48,9 @@ static int phi12(PJ *P, double *del, double *sig) {
}
-static XY loc_for(LP lp, PJ *P, double *yc) {
+static PJ_XY loc_for(PJ_LP lp, PJ *P, double *yc) {
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy;
+ PJ_XY xy;
if (lp.phi == 0.0) {
xy.x = lp.lam;
@@ -97,17 +97,17 @@ static XY loc_for(LP lp, PJ *P, double *yc) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
double yc;
- XY xy = loc_for(lp, P, &yc);
+ PJ_XY xy = loc_for(lp, P, &yc);
return (xy);
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY t;
+ PJ_XY t;
double yc = 0.0;
int i = 0;
const int N_MAX_ITER = 1000; /* Arbitrarily chosen number... */
diff --git a/src/projections/isea.cpp b/src/projections/isea.cpp
index 522e6813..3a0a0a48 100644
--- a/src/projections/isea.cpp
+++ b/src/projections/isea.cpp
@@ -14,7 +14,7 @@
#include "proj_internal.h"
#include "proj_math.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#define DEG36 0.62831853071795864768
#define DEG72 1.25663706143591729537
@@ -995,8 +995,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
struct isea_pt out;
struct isea_geo in;
diff --git a/src/projections/krovak.cpp b/src/projections/krovak.cpp
index 9ecffb89..591f8dcc 100644
--- a/src/projections/krovak.cpp
+++ b/src/projections/krovak.cpp
@@ -80,7 +80,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(krovak, "Krovak") "\n\tPCyl, Ell";
@@ -102,9 +103,9 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy = {0.0,0.0};
+ PJ_XY xy = {0.0,0.0};
double gfi, u, deltav, s, d, eps, rho;
@@ -129,9 +130,9 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- LP lp = {0.0,0.0};
+ PJ_LP lp = {0.0,0.0};
double u, deltav, s, d, eps, rho, fi1, xy0;
int i;
diff --git a/src/projections/labrd.cpp b/src/projections/labrd.cpp
index d3930243..330c105f 100644
--- a/src/projections/labrd.cpp
+++ b/src/projections/labrd.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(labrd, "Laborde") "\n\tCyl, Sph\n\tSpecial for Madagascar";
#define EPS 1.e-10
@@ -15,8 +16,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double V1, V2, ps, sinps, cosps, sinps2, cosps2;
double I1, I2, I3, I4, I5, I6, x2, y2, t;
@@ -48,8 +49,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
/* t = 0.0 optimization is to avoid a false positive cppcheck warning */
/* (cppcheck git beaf29c15867984aa3c2a15cf15bd7576ccde2b3). Might no */
diff --git a/src/projections/laea.cpp b/src/projections/laea.cpp
index dd02c75a..e3c7248a 100644
--- a/src/projections/laea.cpp
+++ b/src/projections/laea.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(laea, "Lambert Azimuthal Equal Area") "\n\tAzi, Sph&Ell";
@@ -32,8 +32,8 @@ struct pj_opaque {
#define EPS10 1.e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinlam, sinphi, q, sinb=0.0, cosb=0.0, b=0.0;
@@ -94,8 +94,8 @@ eqcon:
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -136,8 +136,8 @@ oblcon:
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cCe, sCe, q, rho, ab=0.0;
@@ -185,8 +185,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosz=0.0, rh, sinz=0.0;
diff --git a/src/projections/lagrng.cpp b/src/projections/lagrng.cpp
index a119ea31..65686584 100644
--- a/src/projections/lagrng.cpp
+++ b/src/projections/lagrng.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lagrng, "Lagrange") "\n\tMisc Sph\n\tW=";
@@ -21,8 +21,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double v, c;
@@ -45,8 +45,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c, x2, y2p, y2m;
diff --git a/src/projections/larr.cpp b/src/projections/larr.cpp
index e4d5d240..bab1dbf4 100644
--- a/src/projections/larr.cpp
+++ b/src/projections/larr.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(larr, "Larrivee") "\n\tMisc Sph, no inv";
#define SIXTH .16666666666666666
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = 0.5 * lp.lam * (1. + sqrt(cos(lp.phi)));
diff --git a/src/projections/lask.cpp b/src/projections/lask.cpp
index 46f23edb..c4c6734d 100644
--- a/src/projections/lask.cpp
+++ b/src/projections/lask.cpp
@@ -1,5 +1,7 @@
#define PJ_LIB__
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv";
@@ -15,8 +17,8 @@ PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv";
#define b05 -0.0491032
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double l2, p2;
(void) P;
diff --git a/src/projections/latlong.cpp b/src/projections/latlong.cpp
index 1331d59a..f114504b 100644
--- a/src/projections/latlong.cpp
+++ b/src/projections/latlong.cpp
@@ -30,7 +30,7 @@
/* very loosely based upon DMA code by Bradford W. Drew */
#define PJ_LIB__
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t";
PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t";
@@ -38,8 +38,8 @@ PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") "\n\t";
PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t";
- static XY latlong_forward(LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+ static PJ_XY latlong_forward(PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = lp.lam;
xy.y = lp.phi;
@@ -47,8 +47,8 @@ PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t";
}
-static LP latlong_inverse(XY xy, PJ *P) {
- LP lp = {0.0,0.0};
+static PJ_LP latlong_inverse(PJ_XY xy, PJ *P) {
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = xy.y;
lp.lam = xy.x;
@@ -56,8 +56,8 @@ static LP latlong_inverse(XY xy, PJ *P) {
}
- static XYZ latlong_forward_3d (LPZ lpz, PJ *P) {
- XYZ xyz = {0,0,0};
+ static PJ_XYZ latlong_forward_3d (PJ_LPZ lpz, PJ *P) {
+ PJ_XYZ xyz = {0,0,0};
(void) P;
xyz.x = lpz.lam;
xyz.y = lpz.phi;
@@ -66,8 +66,8 @@ static LP latlong_inverse(XY xy, PJ *P) {
}
-static LPZ latlong_inverse_3d (XYZ xyz, PJ *P) {
- LPZ lpz = {0,0,0};
+static PJ_LPZ latlong_inverse_3d (PJ_XYZ xyz, PJ *P) {
+ PJ_LPZ lpz = {0,0,0};
(void) P;
lpz.lam = xyz.x;
lpz.phi = xyz.y;
diff --git a/src/projections/lcc.cpp b/src/projections/lcc.cpp
index 7d6e3f57..a1fe79a9 100644
--- a/src/projections/lcc.cpp
+++ b/src/projections/lcc.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(lcc, "Lambert Conformal Conic")
@@ -20,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0., 0.};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0., 0.};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
@@ -43,8 +43,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0., 0.};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0., 0.};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
diff --git a/src/projections/lcca.cpp b/src/projections/lcca.cpp
index 70b5dff9..d4dc8641 100644
--- a/src/projections/lcca.cpp
+++ b/src/projections/lcca.cpp
@@ -51,7 +51,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative")
"\n\tConic, Sph&Ell\n\tlat_0=";
@@ -80,8 +80,8 @@ static double fSp(double S, double C) { /* deriv of fs */
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double S, r, dr;
@@ -94,8 +94,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double theta, dr, S, dif;
int i;
diff --git a/src/projections/loxim.cpp b/src/projections/loxim.cpp
index f68e844a..2a780a9e 100644
--- a/src/projections/loxim.cpp
+++ b/src/projections/loxim.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(loxim, "Loximuthal") "\n\tPCyl Sph";
@@ -19,8 +19,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = lp.phi - Q->phi1;
@@ -37,8 +37,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = xy.y + Q->phi1;
diff --git a/src/projections/lsat.cpp b/src/projections/lsat.cpp
index a0eca1bd..5b7520d3 100644
--- a/src/projections/lsat.cpp
+++ b/src/projections/lsat.cpp
@@ -5,7 +5,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lsat, "Space oblique for LANDSAT")
"\n\tCyl, Sph&Ell\n\tlsat= path=";
@@ -44,8 +44,8 @@ static void seraz0(double lam, double mult, PJ *P) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int l, nn;
double lamt = 0.0, xlam, sdsq, c, d, s, lamdp = 0.0, phidp, lampp, tanph;
@@ -107,8 +107,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int nn;
double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
diff --git a/src/projections/mbt_fps.cpp b/src/projections/mbt_fps.cpp
index 66ed9458..beff3314 100644
--- a/src/projections/mbt_fps.cpp
+++ b/src/projections/mbt_fps.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl, Sph";
@@ -15,8 +16,8 @@ PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl, Sph";
#define C_y 1.44492
#define C1_2 0.33333333333333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double k, V, t;
int i;
(void) P;
@@ -36,8 +37,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t;
lp.phi = C2 * (t = aasin(P->ctx,xy.y / C_y));
diff --git a/src/projections/mbtfpp.cpp b/src/projections/mbtfpp.cpp
index 276a43eb..ebd860ee 100644
--- a/src/projections/mbtfpp.cpp
+++ b/src/projections/mbtfpp.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic") "\n\tCyl, Sph";
@@ -15,8 +15,8 @@ PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic") "\n\tCyl, Sph";
#define ONEEPS 1.0000001
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
lp.phi = asin(CS * sin(lp.phi));
@@ -26,8 +26,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / FYC;
if (fabs(lp.phi) >= 1.) {
diff --git a/src/projections/mbtfpq.cpp b/src/projections/mbtfpq.cpp
index b7c0eb16..ec49f9ce 100644
--- a/src/projections/mbtfpq.cpp
+++ b/src/projections/mbtfpq.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl, Sph";
@@ -18,8 +18,8 @@ PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl, Sph";
#define RXC 3.20041258076506210122
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double th1, c;
int i;
(void) P;
@@ -36,8 +36,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t;
lp.phi = RYC * xy.y;
diff --git a/src/projections/merc.cpp b/src/projections/merc.cpp
index 1998234e..5b65de90 100644
--- a/src/projections/merc.cpp
+++ b/src/projections/merc.cpp
@@ -6,7 +6,7 @@
#include "proj_internal.h"
#include "proj.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts=";
PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Ell\n\t";
@@ -20,8 +20,8 @@ static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */
return log(tan(M_FORTPI + .5 * x));
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -32,8 +32,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -44,8 +44,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
if ((lp.phi = pj_phi2(P->ctx, exp(- xy.y / P->k0), P->e)) == HUGE_VAL) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return lp;
@@ -55,8 +55,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = atan(sinh(xy.y / P->k0));
lp.lam = xy.x / P->k0;
return lp;
diff --git a/src/projections/mill.cpp b/src/projections/mill.cpp
index 3ea9636f..5d4acd89 100644
--- a/src/projections/mill.cpp
+++ b/src/projections/mill.cpp
@@ -2,12 +2,13 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(mill, "Miller Cylindrical") "\n\tCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = lp.lam;
@@ -17,8 +18,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = xy.x;
diff --git a/src/projections/misrsom.cpp b/src/projections/misrsom.cpp
index c84b96e3..c53f22a1 100644
--- a/src/projections/misrsom.cpp
+++ b/src/projections/misrsom.cpp
@@ -26,7 +26,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(misrsom, "Space oblique for MISR")
"\n\tCyl, Sph&Ell\n\tpath=";
@@ -62,8 +62,8 @@ static void seraz0(double lam, double mult, PJ *P) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int l, nn;
double lamt = 0.0, xlam, sdsq, c, d, s, lamdp = 0.0, phidp, lampp, tanph;
@@ -123,8 +123,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int nn;
double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
diff --git a/src/projections/mod_ster.cpp b/src/projections/mod_ster.cpp
index 7c4f363b..83390178 100644
--- a/src/projections/mod_ster.cpp
+++ b/src/projections/mod_ster.cpp
@@ -1,7 +1,8 @@
/* based upon Snyder and Linck, USGS-NMD */
#define PJ_LIB__
#include <errno.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(mil_os, "Miller Oblated Stereographic") "\n\tAzi(mod)";
@@ -21,8 +22,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinlon, coslon, esphi, chi, schi, cchi, s;
COMPLEX p;
@@ -45,8 +46,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int nn;
COMPLEX p, fxy, fpxy, dp;
diff --git a/src/projections/moll.cpp b/src/projections/moll.cpp
index c877a1bb..03393b01 100644
--- a/src/projections/moll.cpp
+++ b/src/projections/moll.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(moll, "Mollweide") "\n\tPCyl, Sph";
PROJ_HEAD(wag4, "Wagner IV") "\n\tPCyl, Sph";
@@ -19,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double k, V;
int i;
@@ -42,8 +43,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = aasin(P->ctx, xy.y / Q->C_y);
lp.lam = xy.x / (Q->C_x * cos(lp.phi));
diff --git a/src/projections/natearth.cpp b/src/projections/natearth.cpp
index 27a6b137..d8e52c37 100644
--- a/src/projections/natearth.cpp
+++ b/src/projections/natearth.cpp
@@ -16,7 +16,8 @@ Port to PROJ.4 by Bernhard Jenny, 6 June 2011
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(natearth, "Natural Earth") "\n\tPCyl, Sph";
@@ -41,8 +42,8 @@ PROJ_HEAD(natearth, "Natural Earth") "\n\tPCyl, Sph";
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double phi2, phi4;
(void) P;
@@ -54,8 +55,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, y4, f, fder;
int i;
(void) P;
diff --git a/src/projections/natearth2.cpp b/src/projections/natearth2.cpp
index f6aba671..9849a723 100644
--- a/src/projections/natearth2.cpp
+++ b/src/projections/natearth2.cpp
@@ -9,7 +9,8 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(natearth2, "Natural Earth 2") "\n\tPCyl, Sph";
@@ -33,8 +34,8 @@ PROJ_HEAD(natearth2, "Natural Earth 2") "\n\tPCyl, Sph";
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double phi2, phi4, phi6;
(void) P;
@@ -48,8 +49,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, y4, y6, f, fder;
int i;
(void) P;
diff --git a/src/projections/nell.cpp b/src/projections/nell.cpp
index 2a7ea32c..b6e69dd6 100644
--- a/src/projections/nell.cpp
+++ b/src/projections/nell.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nell, "Nell") "\n\tPCyl, Sph";
@@ -10,8 +11,8 @@ PROJ_HEAD(nell, "Nell") "\n\tPCyl, Sph";
#define LOOP_TOL 1e-7
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double k, V;
int i;
(void) P;
@@ -32,8 +33,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.lam = 2. * xy.x / (1. + cos(xy.y));
lp.phi = aasin(P->ctx,0.5 * (xy.y + sin(xy.y)));
diff --git a/src/projections/nell_h.cpp b/src/projections/nell_h.cpp
index 28c3ace7..be28b917 100644
--- a/src/projections/nell_h.cpp
+++ b/src/projections/nell_h.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl, Sph";
@@ -10,8 +11,8 @@ PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl, Sph";
#define EPS 1e-7
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = 0.5 * lp.lam * (1. + cos(lp.phi));
@@ -21,8 +22,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double V, c, p;
int i;
(void) P;
diff --git a/src/projections/nicol.cpp b/src/projections/nicol.cpp
index 541d08b2..c4bee261 100644
--- a/src/projections/nicol.cpp
+++ b/src/projections/nicol.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nicol, "Nicolosi Globular") "\n\tMisc Sph, no inv";
#define EPS 1e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
if (fabs(lp.lam) < EPS) {
diff --git a/src/projections/nsper.cpp b/src/projections/nsper.cpp
index f93010f8..a0bb5686 100644
--- a/src/projections/nsper.cpp
+++ b/src/projections/nsper.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -38,8 +38,8 @@ PROJ_HEAD(tpers, "Tilted perspective") "\n\tAzi, Sph\n\ttilt= azi= h=";
# define EPS10 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -93,8 +93,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, cosz, sinz;
diff --git a/src/projections/nzmg.cpp b/src/projections/nzmg.cpp
index bf0862fb..1c2d9fb7 100644
--- a/src/projections/nzmg.cpp
+++ b/src/projections/nzmg.cpp
@@ -29,7 +29,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nzmg, "New Zealand Map Grid") "\n\tfixed Earth";
@@ -57,8 +58,8 @@ static const double tpsi[] = { .6399175073, -.1358797613, .063294409, -.02526853
#define Ntphi 8
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
COMPLEX p;
const double *C;
int i;
@@ -76,8 +77,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
int nn, i;
COMPLEX p, f, fp, dp;
double den;
diff --git a/src/projections/ob_tran.cpp b/src/projections/ob_tran.cpp
index d34059a9..1726b622 100644
--- a/src/projections/ob_tran.cpp
+++ b/src/projections/ob_tran.cpp
@@ -5,7 +5,7 @@
#include <string.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -24,7 +24,7 @@ PROJ_HEAD(ob_tran, "General Oblique Transformation") "\n\tMisc Sph"
#define TOL 1e-10
-static XY o_forward(LP lp, PJ *P) { /* spheroid */
+static PJ_XY o_forward(PJ_LP lp, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinphi, cosphi;
@@ -39,7 +39,7 @@ static XY o_forward(LP lp, PJ *P) { /* spheroid */
}
-static XY t_forward(LP lp, PJ *P) { /* spheroid */
+static PJ_XY t_forward(PJ_LP lp, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, coslam;
@@ -52,12 +52,12 @@ static XY t_forward(LP lp, PJ *P) { /* spheroid */
}
-static LP o_inverse(XY xy, PJ *P) { /* spheroid */
+static PJ_LP o_inverse(PJ_XY xy, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinphi, cosphi;
- LP lp = Q->link->inv(xy, Q->link);
+ PJ_LP lp = Q->link->inv(xy, Q->link);
if (lp.lam != HUGE_VAL) {
coslam = cos(lp.lam -= Q->lamp);
sinphi = sin(lp.phi);
@@ -70,12 +70,12 @@ static LP o_inverse(XY xy, PJ *P) { /* spheroid */
}
-static LP t_inverse(XY xy, PJ *P) { /* spheroid */
+static PJ_LP t_inverse(PJ_XY xy, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, t;
- LP lp = Q->link->inv(xy, Q->link);
+ PJ_LP lp = Q->link->inv(xy, Q->link);
if (lp.lam != HUGE_VAL) {
cosphi = cos(lp.phi);
t = lp.lam - Q->lamp;
diff --git a/src/projections/ocea.cpp b/src/projections/ocea.cpp
index 0576ace7..75aa6666 100644
--- a/src/projections/ocea.cpp
+++ b/src/projections/ocea.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area") "\n\tCyl, Sph"
"lonc= alpha= or\n\tlat_1= lat_2= lon_1= lon_2=";
@@ -20,8 +21,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t;
xy.y = sin(lp.lam);
@@ -35,8 +36,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t, s;
diff --git a/src/projections/oea.cpp b/src/projections/oea.cpp
index 0c401b2f..f2fc1053 100644
--- a/src/projections/oea.cpp
+++ b/src/projections/oea.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(oea, "Oblated Equal Area") "\n\tMisc Sph\n\tn= m= theta=";
@@ -16,8 +16,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Az, M, N, cp, sp, cl, shz;
@@ -35,8 +35,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double N, M, xp, yp, z, Az, cz, sz, cAz;
diff --git a/src/projections/omerc.cpp b/src/projections/omerc.cpp
index ead07128..e9b7b4a0 100644
--- a/src/projections/omerc.cpp
+++ b/src/projections/omerc.cpp
@@ -27,7 +27,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(omerc, "Oblique Mercator")
"\n\tCyl, Sph&Ell no_rot\n\t"
@@ -45,8 +45,8 @@ struct pj_opaque {
#define EPS 1.e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double S, T, U, V, W, temp, u, v;
@@ -84,8 +84,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double u, v, Qp, Sp, Tp, Vp, Up;
diff --git a/src/projections/ortho.cpp b/src/projections/ortho.cpp
index 6ea55248..d4300bd5 100644
--- a/src/projections/ortho.cpp
+++ b/src/projections/ortho.cpp
@@ -3,7 +3,7 @@
#include "proj.h"
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(ortho, "Orthographic") "\n\tAzi, Sph";
@@ -26,15 +26,15 @@ struct pj_opaque {
#define EPS10 1.e-10
-static XY forward_error(PJ *P, LP lp, XY xy) {
+static PJ_XY forward_error(PJ *P, PJ_LP lp, PJ_XY xy) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
proj_log_trace(P, "Coordinate (%.3f, %.3f) is on the unprojected hemisphere",
proj_todeg(lp.lam), proj_todeg(lp.phi));
return xy;
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -67,8 +67,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp;
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, cosc, sinc;
diff --git a/src/projections/patterson.cpp b/src/projections/patterson.cpp
index 0d19414e..7f0ea3a9 100644
--- a/src/projections/patterson.cpp
+++ b/src/projections/patterson.cpp
@@ -42,7 +42,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(patterson, "Patterson Cylindrical") "\n\tCyl";
@@ -60,8 +61,8 @@ PROJ_HEAD(patterson, "Patterson Cylindrical") "\n\tCyl";
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double phi2;
(void) P;
@@ -73,8 +74,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, f, fder;
int i;
(void) P;
diff --git a/src/projections/poly.cpp b/src/projections/poly.cpp
index a970fdb1..b4b61b00 100644
--- a/src/projections/poly.cpp
+++ b/src/projections/poly.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(poly, "Polyconic (American)")
"\n\tConic, Sph&Ell";
@@ -23,8 +23,8 @@ struct pj_opaque {
#define ITOL 1.e-12
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double ms, sp, cp;
@@ -42,8 +42,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cot, E;
@@ -60,8 +60,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y += Q->ml0;
@@ -104,8 +104,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double B, dphi, tp;
int i;
diff --git a/src/projections/putp2.cpp b/src/projections/putp2.cpp
index d7a847c8..d5b3b9f5 100644
--- a/src/projections/putp2.cpp
+++ b/src/projections/putp2.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl, Sph";
@@ -14,8 +15,8 @@ PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl, Sph";
#define PI_DIV_3 1.0471975511965977
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double p, c, s, V;
int i;
(void) P;
@@ -40,8 +41,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double c;
lp.phi = aasin(P->ctx,xy.y / C_y);
diff --git a/src/projections/putp3.cpp b/src/projections/putp3.cpp
index 98bb2ff0..bc4a02e4 100644
--- a/src/projections/putp3.cpp
+++ b/src/projections/putp3.cpp
@@ -1,6 +1,8 @@
#define PJ_LIB__
#include <errno.h>
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -15,8 +17,8 @@ PROJ_HEAD(putp3p, "Putnins P3'") "\n\tPCyl, Sph";
#define RPISQ 0.1013211836
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = C * lp.lam * (1. - static_cast<struct pj_opaque*>(P->opaque)->A * lp.phi * lp.phi);
xy.y = C * lp.phi;
@@ -25,8 +27,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / C;
lp.lam = xy.x / (C * (1. - static_cast<struct pj_opaque*>(P->opaque)->A * lp.phi * lp.phi));
diff --git a/src/projections/putp4p.cpp b/src/projections/putp4p.cpp
index 608fc76e..462dae81 100644
--- a/src/projections/putp4p.cpp
+++ b/src/projections/putp4p.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -15,8 +16,8 @@ PROJ_HEAD(putp4p, "Putnins P4'") "\n\tPCyl, Sph";
PROJ_HEAD(weren, "Werenskiold I") "\n\tPCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = aasin(P->ctx,0.883883476 * sin(lp.phi));
@@ -28,8 +29,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = aasin(P->ctx,xy.y / Q->C_y);
diff --git a/src/projections/putp5.cpp b/src/projections/putp5.cpp
index 79e2ad15..62cb2ea9 100644
--- a/src/projections/putp5.cpp
+++ b/src/projections/putp5.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -18,8 +19,8 @@ PROJ_HEAD(putp5p, "Putnins P5'") "\n\tPCyl, Sph";
#define D 1.2158542
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.x = C * lp.lam * (Q->A - Q->B * sqrt(1. + D * lp.phi * lp.phi));
@@ -29,8 +30,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = xy.y / C;
diff --git a/src/projections/putp6.cpp b/src/projections/putp6.cpp
index 1186b18b..4bae7ae6 100644
--- a/src/projections/putp6.cpp
+++ b/src/projections/putp6.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -19,8 +20,8 @@ PROJ_HEAD(putp6p, "Putnins P6'") "\n\tPCyl, Sph";
#define CON_POLE 1.732050807568877
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double p, r, V;
int i;
@@ -43,8 +44,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double r;
diff --git a/src/projections/qsc.cpp b/src/projections/qsc.cpp
index b50a7c95..409afb38 100644
--- a/src/projections/qsc.cpp
+++ b/src/projections/qsc.cpp
@@ -43,7 +43,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* The six cube faces. */
namespace { // anonymous namespace
@@ -118,8 +119,8 @@ static double qsc_shift_lon_origin(double lon, double offset) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double lat, lon;
double theta, phi;
@@ -234,8 +235,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double mu, nu, cosmu, tannu;
double tantheta, theta, cosphi, phi;
diff --git a/src/projections/robin.cpp b/src/projections/robin.cpp
index 987977ae..8f142aad 100644
--- a/src/projections/robin.cpp
+++ b/src/projections/robin.cpp
@@ -2,7 +2,7 @@
#include "proj_math.h"
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(robin, "Robinson") "\n\tPCyl, Sph";
@@ -78,8 +78,8 @@ static const struct COEFS Y[] = {
/* Not sure at all of the appropriate number for MAX_ITER... */
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
long i;
double dphi;
(void) P;
@@ -100,8 +100,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
long i;
double t, t1;
struct COEFS T;
diff --git a/src/projections/rouss.cpp b/src/projections/rouss.cpp
index 3b4428bc..f58277b8 100644
--- a/src/projections/rouss.cpp
+++ b/src/projections/rouss.cpp
@@ -29,7 +29,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -44,8 +44,8 @@ struct pj_opaque {
PROJ_HEAD(rouss, "Roussilhe Stereographic") "\n\tAzi, Ell";
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double s, al, cp, sp, al2, s2;
@@ -65,8 +65,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double s, al, x = xy.x / P->k0, y = xy.y / P->k0, x2, y2;;
diff --git a/src/projections/rpoly.cpp b/src/projections/rpoly.cpp
index a34f6171..6e883ab2 100644
--- a/src/projections/rpoly.cpp
+++ b/src/projections/rpoly.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -19,8 +20,8 @@ PROJ_HEAD(rpoly, "Rectangular Polyconic")
#define EPS 1e-9
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double fa;
diff --git a/src/projections/sch.cpp b/src/projections/sch.cpp
index 5a2f944b..f4c66688 100644
--- a/src/projections/sch.cpp
+++ b/src/projections/sch.cpp
@@ -36,7 +36,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "geocent.h"
namespace { // anonymous namespace
@@ -55,8 +55,8 @@ struct pj_opaque {
PROJ_HEAD(sch, "Spherical Cross-track Height") "\n\tMisc\n\tplat_0= plon_0= phdg_0= [h_0=]";
-static LPZ inverse3d(XYZ xyz, PJ *P) {
- LPZ lpz = {0.0, 0.0, 0.0};
+static PJ_LPZ inverse3d(PJ_XYZ xyz, PJ *P) {
+ PJ_LPZ lpz = {0.0, 0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double temp[3];
double pxyz[3];
@@ -93,8 +93,8 @@ static LPZ inverse3d(XYZ xyz, PJ *P) {
return lpz;
}
-static XYZ forward3d(LPZ lpz, PJ *P) {
- XYZ xyz = {0.0, 0.0, 0.0};
+static PJ_XYZ forward3d(PJ_LPZ lpz, PJ *P) {
+ PJ_XYZ xyz = {0.0, 0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double temp[3];
double pxyz[3];
diff --git a/src/projections/sconics.cpp b/src/projections/sconics.cpp
index 1d19a13d..7bdd2603 100644
--- a/src/projections/sconics.cpp
+++ b/src/projections/sconics.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -62,8 +62,8 @@ static int phi12(PJ *P, double *del) {
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
@@ -85,8 +85,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, (and ellipsoidal?) inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, (and ellipsoidal?) inverse */
+ PJ_LP lp = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
diff --git a/src/projections/somerc.cpp b/src/projections/somerc.cpp
index 15d2e765..ead9090f 100644
--- a/src/projections/somerc.cpp
+++ b/src/projections/somerc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(somerc, "Swiss. Obl. Mercator") "\n\tCyl, Ell\n\tFor CH1903";
@@ -18,8 +18,8 @@ struct pj_opaque {
#define NITER 6
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double phip, lamp, phipp, lampp, sp, cp;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
@@ -37,8 +37,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double phip, lamp, phipp, lampp, cp, esp, con, delp;
int i;
diff --git a/src/projections/stere.cpp b/src/projections/stere.cpp
index 1502b2a6..9b24a596 100644
--- a/src/projections/stere.cpp
+++ b/src/projections/stere.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(stere, "Stereographic") "\n\tAzi, Sph&Ell\n\tlat_ts=";
@@ -41,8 +41,8 @@ static double ssfn_ (double phit, double sinphi, double eccen) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinlam, sinX = 0.0, cosX = 0.0, X, A = 0.0, sinphi;
@@ -89,8 +89,8 @@ xmul:
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinphi, cosphi, coslam, sinlam;
@@ -131,8 +131,8 @@ oblcon:
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, sinphi, tp=0.0, phi_l=0.0, rho, halfe=0.0, halfpi=0.0;
int i;
@@ -181,8 +181,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c, rh, sinc, cosc;
diff --git a/src/projections/sterea.cpp b/src/projections/sterea.cpp
index bb498068..b6ebc7b4 100644
--- a/src/projections/sterea.cpp
+++ b/src/projections/sterea.cpp
@@ -25,7 +25,8 @@
*/
#define PJ_LIB__
#include <errno.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -43,8 +44,8 @@ PROJ_HEAD(sterea, "Oblique Stereographic Alternative") "\n\tAzimuthal, Sph&Ell";
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosc, sinc, cosl, k;
@@ -59,8 +60,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho, c, sinc, cosc;
diff --git a/src/projections/sts.cpp b/src/projections/sts.cpp
index 9f889611..27dc3eb8 100644
--- a/src/projections/sts.cpp
+++ b/src/projections/sts.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(kav5, "Kavraisky V") "\n\tPCyl, Sph";
PROJ_HEAD(qua_aut, "Quartic Authalic") "\n\tPCyl, Sph";
@@ -19,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c;
@@ -39,8 +40,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c;
diff --git a/src/projections/tcc.cpp b/src/projections/tcc.cpp
index 64fdc182..cfac9974 100644
--- a/src/projections/tcc.cpp
+++ b/src/projections/tcc.cpp
@@ -3,15 +3,15 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tcc, "Transverse Central Cylindrical") "\n\tCyl, Sph, no inv";
#define EPS10 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double b, bt;
b = cos (lp.phi) * sin (lp.lam);
diff --git a/src/projections/tcea.cpp b/src/projections/tcea.cpp
index d30f3df0..d780718d 100644
--- a/src/projections/tcea.cpp
+++ b/src/projections/tcea.cpp
@@ -2,21 +2,22 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = cos (lp.phi) * sin (lp.lam) / P->k0;
xy.y = P->k0 * (atan2 (tan (lp.phi), cos (lp.lam)) - P->phi0);
return xy;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
double t;
xy.y = xy.y / P->k0 + P->phi0;
diff --git a/src/projections/times.cpp b/src/projections/times.cpp
index e8b4499f..4a0d0f59 100644
--- a/src/projections/times.cpp
+++ b/src/projections/times.cpp
@@ -33,13 +33,14 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(times, "Times") "\n\tCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
double T, S, S2;
- XY xy = {0.0,0.0};
+ PJ_XY xy = {0.0,0.0};
(void) P;
T = tan(lp.phi/2.0);
@@ -53,9 +54,9 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
double T, S, S2;
- LP lp = {0.0,0.0};
+ PJ_LP lp = {0.0,0.0};
(void) P;
T = xy.y / 1.70711;
diff --git a/src/projections/tmerc.cpp b/src/projections/tmerc.cpp
index 5a2dacbd..d1938116 100644
--- a/src/projections/tmerc.cpp
+++ b/src/projections/tmerc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tmerc, "Transverse Mercator") "\n\tCyl, Sph&Ell";
@@ -28,8 +28,8 @@ struct pj_opaque {
#define FC8 .01785714285714285714
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double al, als, n, cosphi, sinphi, t;
@@ -70,8 +70,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double b, cosphi;
/*
@@ -115,8 +115,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double n, con, cosphi, d, ds, sinphi, t;
@@ -149,8 +149,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
double h, g;
h = exp(xy.x / static_cast<struct pj_opaque*>(P->opaque)->esp);
diff --git a/src/projections/tobmerc.cpp b/src/projections/tobmerc.cpp
index 9c939f0b..95960097 100644
--- a/src/projections/tobmerc.cpp
+++ b/src/projections/tobmerc.cpp
@@ -6,7 +6,7 @@
#include "proj_internal.h"
#include "proj.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tobmerc, "Tobler-Mercator") "\n\tCyl, Sph";
@@ -19,8 +19,8 @@ static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */
return log(tan(M_FORTPI + .5 * x));
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double cosphi;
if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) {
@@ -34,8 +34,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
return xy;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
double cosphi;
lp.phi = atan(sinh(xy.y / P->k0));
diff --git a/src/projections/tpeqd.cpp b/src/projections/tpeqd.cpp
index 2720327a..20921de4 100644
--- a/src/projections/tpeqd.cpp
+++ b/src/projections/tpeqd.cpp
@@ -2,7 +2,7 @@
#include <errno.h>
#include "proj.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tpeqd, "Two Point Equidistant")
@@ -16,8 +16,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t, z1, z2, dl1, dl2, sp, cp;
@@ -37,8 +37,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cz1, cz2, s, d, cp, sp;
diff --git a/src/projections/urm5.cpp b/src/projections/urm5.cpp
index 0e3c7e3c..a93293c0 100644
--- a/src/projections/urm5.cpp
+++ b/src/projections/urm5.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl, Sph, no inv\n\tn= q= alpha=";
@@ -15,8 +15,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t;
diff --git a/src/projections/urmfps.cpp b/src/projections/urmfps.cpp
index 7103222a..3a51798b 100644
--- a/src/projections/urmfps.cpp
+++ b/src/projections/urmfps.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph\n\tn=";
PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph";
@@ -19,8 +19,8 @@ struct pj_opaque {
#define Cy 1.139753528477
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
lp.phi = aasin (P->ctx,static_cast<struct pj_opaque*>(P->opaque)->n * sin (lp.phi));
xy.x = C_x * lp.lam * cos (lp.phi);
xy.y = static_cast<struct pj_opaque*>(P->opaque)->C_y * lp.phi;
@@ -28,8 +28,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
xy.y /= static_cast<struct pj_opaque*>(P->opaque)->C_y;
lp.phi = aasin(P->ctx, sin (xy.y) / static_cast<struct pj_opaque*>(P->opaque)->n);
lp.lam = xy.x / (C_x * cos (xy.y));
diff --git a/src/projections/vandg.cpp b/src/projections/vandg.cpp
index d148e210..89620356 100644
--- a/src/projections/vandg.cpp
+++ b/src/projections/vandg.cpp
@@ -1,6 +1,6 @@
#define PJ_LIB__
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(vandg, "van der Grinten (I)") "\n\tMisc Sph";
@@ -13,8 +13,8 @@ PROJ_HEAD(vandg, "van der Grinten (I)") "\n\tMisc Sph";
# define HPISQ 4.93480220054467930934
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double al, al2, g, g2, p2;
p2 = fabs(lp.phi / M_HALFPI);
@@ -58,8 +58,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t, c0, c1, c2, c3, al, r2, r, m, d, ay, x2, y2;
x2 = xy.x * xy.x;
diff --git a/src/projections/vandg2.cpp b/src/projections/vandg2.cpp
index 61d50044..de63b085 100644
--- a/src/projections/vandg2.cpp
+++ b/src/projections/vandg2.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -17,8 +18,8 @@ PROJ_HEAD(vandg3, "van der Grinten III") "\n\tMisc Sph, no inv";
#define TOL 1e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double x1, at, bt, ct;
diff --git a/src/projections/vandg4.cpp b/src/projections/vandg4.cpp
index d9a53c87..8511431d 100644
--- a/src/projections/vandg4.cpp
+++ b/src/projections/vandg4.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(vandg4, "van der Grinten IV") "\n\tMisc Sph, no inv";
#define TOL 1e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double x1, t, bt, ct, ft, bt2, ct2, dt, dt2;
(void) P;
diff --git a/src/projections/wag2.cpp b/src/projections/wag2.cpp
index 1bee737a..e04cc648 100644
--- a/src/projections/wag2.cpp
+++ b/src/projections/wag2.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl, Sph";
#define C_p2 0.88550
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
lp.phi = aasin (P->ctx,C_p1 * sin (C_p2 * lp.phi));
xy.x = C_x * lp.lam * cos (lp.phi);
xy.y = C_y * lp.phi;
@@ -21,8 +22,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / C_y;
lp.lam = xy.x / (C_x * cos(lp.phi));
lp.phi = aasin (P->ctx,sin(lp.phi) / C_p1) / C_p2;
diff --git a/src/projections/wag3.cpp b/src/projections/wag3.cpp
index bb1b4d49..ed695ffd 100644
--- a/src/projections/wag3.cpp
+++ b/src/projections/wag3.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl, Sph\n\tlat_ts=";
@@ -16,16 +17,16 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = static_cast<struct pj_opaque*>(P->opaque)->C_x * lp.lam * cos(TWOTHIRD * lp.phi);
xy.y = lp.phi;
return xy;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y;
lp.lam = xy.x / (static_cast<struct pj_opaque*>(P->opaque)->C_x * cos(TWOTHIRD * lp.phi));
return lp;
diff --git a/src/projections/wag7.cpp b/src/projections/wag7.cpp
index c8807f12..45b70ee2 100644
--- a/src/projections/wag7.cpp
+++ b/src/projections/wag7.cpp
@@ -2,14 +2,15 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wag7, "Wagner VII") "\n\tMisc Sph, no inv";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double theta, ct, D;
(void) P; /* Shut up compiler warnnings about unused P */
diff --git a/src/projections/wink1.cpp b/src/projections/wink1.cpp
index de2f55ee..75abbffc 100644
--- a/src/projections/wink1.cpp
+++ b/src/projections/wink1.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wink1, "Winkel I") "\n\tPCyl, Sph\n\tlat_ts=";
@@ -15,16 +16,16 @@ struct pj_opaque {
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = .5 * lp.lam * (static_cast<struct pj_opaque*>(P->opaque)->cosphi1 + cos(lp.phi));
xy.y = lp.phi;
return (xy);
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y;
lp.lam = 2. * xy.x / (static_cast<struct pj_opaque*>(P->opaque)->cosphi1 + cos(lp.phi));
return (lp);
diff --git a/src/projections/wink2.cpp b/src/projections/wink2.cpp
index 74a47283..6957bde1 100644
--- a/src/projections/wink2.cpp
+++ b/src/projections/wink2.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl, Sph, no inv\n\tlat_1=";
@@ -17,8 +18,8 @@ struct pj_opaque {
#define LOOP_TOL 1e-7
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double k, V;
int i;