aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-26 14:22:34 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-30 21:48:56 +0100
commit1b1d60e83a20412aeca3e440705df820979af03b (patch)
treea96858922bc09392b5cea01750b05115f4f3afff /src
parentc9b32000d5fc12705bea92e6509fbedb37193012 (diff)
downloadPROJ-1b1d60e83a20412aeca3e440705df820979af03b.tar.gz
PROJ-1b1d60e83a20412aeca3e440705df820979af03b.zip
projects.h: remove deprecated XY, XYZ, LP, LPZ, UV, UVW, projUV and projUVW structures
Diffstat (limited to 'src')
-rw-r--r--src/aasincos.cpp1
-rw-r--r--src/adjlon.cpp2
-rw-r--r--src/apply_gridshift.cpp12
-rw-r--r--src/apply_vgridshift.cpp6
-rw-r--r--src/apps/cs2cs.cpp2
-rw-r--r--src/apps/gen_cheb.cpp7
-rw-r--r--src/apps/geod_interface.cpp1
-rw-r--r--src/apps/nad2bin.cpp2
-rw-r--r--src/apps/p_series.cpp1
-rw-r--r--src/apps/proj.cpp22
-rw-r--r--src/apps/projinfo.cpp1
-rw-r--r--src/auth.cpp1
-rw-r--r--src/bch2bps.cpp40
-rw-r--r--src/bchgen.cpp9
-rw-r--r--src/biveval.cpp21
-rw-r--r--src/conversions/axisswap.cpp9
-rw-r--r--src/conversions/cart.cpp12
-rw-r--r--src/conversions/geocent.cpp10
-rw-r--r--src/conversions/unitconvert.cpp8
-rw-r--r--src/deriv.cpp4
-rw-r--r--src/dmstor.cpp1
-rw-r--r--src/errno.cpp1
-rw-r--r--src/factors.cpp2
-rw-r--r--src/fileapi.cpp1
-rw-r--r--src/fwd.cpp4
-rw-r--r--src/gauss.cpp9
-rw-r--r--src/gc_reader.cpp1
-rw-r--r--src/gridcatalog.cpp4
-rw-r--r--src/gridinfo.cpp4
-rw-r--r--src/gridlist.cpp1
-rw-r--r--src/initcache.cpp1
-rw-r--r--src/inv.cpp4
-rw-r--r--src/iso19111/coordinateoperation.cpp4
-rw-r--r--src/mk_cheby.cpp13
-rw-r--r--src/mlfn.cpp1
-rw-r--r--src/msfn.cpp1
-rw-r--r--src/mutex.cpp1
-rw-r--r--src/nad_cvt.cpp4
-rw-r--r--src/nad_init.cpp1
-rw-r--r--src/nad_intr.cpp5
-rw-r--r--src/param.cpp1
-rw-r--r--src/phi2.cpp1
-rw-r--r--src/pipeline.cpp16
-rw-r--r--src/pr_list.cpp1
-rw-r--r--src/proj_mdist.cpp1
-rw-r--r--src/projections/aea.cpp8
-rw-r--r--src/projections/aeqd.cpp24
-rw-r--r--src/projections/airy.cpp4
-rw-r--r--src/projections/aitoff.cpp8
-rw-r--r--src/projections/august.cpp5
-rw-r--r--src/projections/bacon.cpp5
-rw-r--r--src/projections/bertin1953.cpp4
-rw-r--r--src/projections/bipc.cpp8
-rw-r--r--src/projections/boggs.cpp5
-rw-r--r--src/projections/bonne.cpp16
-rw-r--r--src/projections/calcofi.cpp16
-rw-r--r--src/projections/cass.cpp17
-rw-r--r--src/projections/cc.cpp8
-rw-r--r--src/projections/ccon.cpp8
-rw-r--r--src/projections/cea.cpp16
-rw-r--r--src/projections/chamb.cpp8
-rw-r--r--src/projections/collg.cpp8
-rw-r--r--src/projections/comill.cpp9
-rw-r--r--src/projections/crast.cpp9
-rw-r--r--src/projections/denoy.cpp5
-rw-r--r--src/projections/eck1.cpp9
-rw-r--r--src/projections/eck2.cpp8
-rw-r--r--src/projections/eck3.cpp9
-rw-r--r--src/projections/eck4.cpp9
-rw-r--r--src/projections/eck5.cpp9
-rw-r--r--src/projections/eqc.cpp8
-rw-r--r--src/projections/eqdc.cpp8
-rw-r--r--src/projections/eqearth.cpp9
-rw-r--r--src/projections/etmerc.cpp8
-rw-r--r--src/projections/fahey.cpp9
-rw-r--r--src/projections/fouc_s.cpp8
-rw-r--r--src/projections/gall.cpp9
-rw-r--r--src/projections/geos.cpp16
-rw-r--r--src/projections/gins8.cpp6
-rw-r--r--src/projections/gn_sinu.cpp16
-rw-r--r--src/projections/gnom.cpp8
-rw-r--r--src/projections/goode.cpp8
-rw-r--r--src/projections/gstmerc.cpp9
-rw-r--r--src/projections/hammer.cpp8
-rw-r--r--src/projections/hatano.cpp8
-rw-r--r--src/projections/healpix.cpp74
-rw-r--r--src/projections/igh.cpp13
-rw-r--r--src/projections/imw_p.cpp14
-rw-r--r--src/projections/isea.cpp4
-rw-r--r--src/projections/krovak.cpp9
-rw-r--r--src/projections/labrd.cpp9
-rw-r--r--src/projections/laea.cpp16
-rw-r--r--src/projections/lagrng.cpp8
-rw-r--r--src/projections/larr.cpp5
-rw-r--r--src/projections/lask.cpp6
-rw-r--r--src/projections/latlong.cpp16
-rw-r--r--src/projections/lcc.cpp8
-rw-r--r--src/projections/lcca.cpp8
-rw-r--r--src/projections/loxim.cpp8
-rw-r--r--src/projections/lsat.cpp8
-rw-r--r--src/projections/mbt_fps.cpp9
-rw-r--r--src/projections/mbtfpp.cpp8
-rw-r--r--src/projections/mbtfpq.cpp8
-rw-r--r--src/projections/merc.cpp16
-rw-r--r--src/projections/mill.cpp9
-rw-r--r--src/projections/misrsom.cpp8
-rw-r--r--src/projections/mod_ster.cpp9
-rw-r--r--src/projections/moll.cpp9
-rw-r--r--src/projections/natearth.cpp9
-rw-r--r--src/projections/natearth2.cpp9
-rw-r--r--src/projections/nell.cpp9
-rw-r--r--src/projections/nell_h.cpp9
-rw-r--r--src/projections/nicol.cpp5
-rw-r--r--src/projections/nsper.cpp8
-rw-r--r--src/projections/nzmg.cpp9
-rw-r--r--src/projections/ob_tran.cpp12
-rw-r--r--src/projections/ocea.cpp9
-rw-r--r--src/projections/oea.cpp8
-rw-r--r--src/projections/omerc.cpp8
-rw-r--r--src/projections/ortho.cpp10
-rw-r--r--src/projections/patterson.cpp9
-rw-r--r--src/projections/poly.cpp16
-rw-r--r--src/projections/putp2.cpp9
-rw-r--r--src/projections/putp3.cpp10
-rw-r--r--src/projections/putp4p.cpp9
-rw-r--r--src/projections/putp5.cpp9
-rw-r--r--src/projections/putp6.cpp9
-rw-r--r--src/projections/qsc.cpp9
-rw-r--r--src/projections/robin.cpp8
-rw-r--r--src/projections/rouss.cpp8
-rw-r--r--src/projections/rpoly.cpp5
-rw-r--r--src/projections/sch.cpp8
-rw-r--r--src/projections/sconics.cpp8
-rw-r--r--src/projections/somerc.cpp8
-rw-r--r--src/projections/stere.cpp16
-rw-r--r--src/projections/sterea.cpp9
-rw-r--r--src/projections/sts.cpp9
-rw-r--r--src/projections/tcc.cpp4
-rw-r--r--src/projections/tcea.cpp9
-rw-r--r--src/projections/times.cpp9
-rw-r--r--src/projections/tmerc.cpp16
-rw-r--r--src/projections/tobmerc.cpp8
-rw-r--r--src/projections/tpeqd.cpp8
-rw-r--r--src/projections/urm5.cpp4
-rw-r--r--src/projections/urmfps.cpp8
-rw-r--r--src/projections/vandg.cpp8
-rw-r--r--src/projections/vandg2.cpp5
-rw-r--r--src/projections/vandg4.cpp5
-rw-r--r--src/projections/wag2.cpp9
-rw-r--r--src/projections/wag3.cpp9
-rw-r--r--src/projections/wag7.cpp5
-rw-r--r--src/projections/wink1.cpp9
-rw-r--r--src/projections/wink2.cpp5
-rw-r--r--src/projects.h76
-rw-r--r--src/qsfn.cpp1
-rw-r--r--src/rtodms.cpp1
-rw-r--r--src/strtod.cpp1
-rw-r--r--src/transform.cpp16
-rw-r--r--src/transformations/affine.cpp8
-rw-r--r--src/transformations/deformation.cpp20
-rw-r--r--src/transformations/helmert.cpp20
-rw-r--r--src/transformations/hgridshift.cpp4
-rw-r--r--src/transformations/horner.cpp19
-rw-r--r--src/transformations/molodensky.cpp18
-rw-r--r--src/transformations/vgridshift.cpp4
-rw-r--r--src/tsfn.cpp1
-rw-r--r--src/utils.cpp1
-rw-r--r--src/vector1.cpp1
-rw-r--r--src/zpoly1.cpp1
169 files changed, 775 insertions, 711 deletions
diff --git a/src/aasincos.cpp b/src/aasincos.cpp
index 4f9ea25f..d2851716 100644
--- a/src/aasincos.cpp
+++ b/src/aasincos.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
#define ONE_TOL 1.00000000000001
diff --git a/src/adjlon.cpp b/src/adjlon.cpp
index 784a90aa..52448c2e 100644
--- a/src/adjlon.cpp
+++ b/src/adjlon.cpp
@@ -1,5 +1,7 @@
/* reduce argument to range +/- PI */
#include <math.h>
+
+#include "proj.h"
#include "projects.h"
double adjlon (double lon) {
diff --git a/src/apply_gridshift.cpp b/src/apply_gridshift.cpp
index da02b6b2..4fd9b077 100644
--- a/src/apply_gridshift.cpp
+++ b/src/apply_gridshift.cpp
@@ -113,7 +113,7 @@ int pj_apply_gridshift_2( PJ *defn, int inverse,
/* Determine which grid is the correct given an input coordinate. */
/************************************************************************/
-static struct CTABLE* find_ctable(projCtx ctx, LP input, int grid_count, PJ_GRIDINFO **tables) {
+static struct CTABLE* find_ctable(projCtx ctx, PJ_LP input, int grid_count, PJ_GRIDINFO **tables) {
int itable;
/* keep trying till we find a table that works */
@@ -197,7 +197,7 @@ int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **gridlist, int gridlist_coun
for( i = 0; i < point_count; i++ )
{
long io = i * point_offset;
- LP input, output;
+ PJ_LP input, output;
int itable;
input.phi = y[io];
@@ -307,9 +307,9 @@ int proj_hgrid_init(PJ* P, const char *grids) {
/* */
/* Return coordinate offset in grid */
/********************************************/
-LP proj_hgrid_value(PJ *P, LP lp) {
+PJ_LP proj_hgrid_value(PJ *P, PJ_LP lp) {
struct CTABLE *ct;
- LP out = proj_coord_error().lp;
+ PJ_LP out = proj_coord_error().lp;
ct = find_ctable(P->ctx, lp, P->gridlist_count, P->gridlist);
if (ct == nullptr) {
@@ -332,10 +332,10 @@ LP proj_hgrid_value(PJ *P, LP lp) {
return out;
}
-LP proj_hgrid_apply(PJ *P, LP lp, PJ_DIRECTION direction) {
+PJ_LP proj_hgrid_apply(PJ *P, PJ_LP lp, PJ_DIRECTION direction) {
struct CTABLE *ct;
int inverse;
- LP out;
+ PJ_LP out;
out.lam = HUGE_VAL; out.phi = HUGE_VAL;
diff --git a/src/apply_vgridshift.cpp b/src/apply_vgridshift.cpp
index 1facfed6..5384f368 100644
--- a/src/apply_vgridshift.cpp
+++ b/src/apply_vgridshift.cpp
@@ -44,7 +44,7 @@ static int is_nodata(float value)
return value > 1000 || value < -1000 || value == -88.88880f;
}
-static double read_vgrid_value( PJ *defn, LP input, int *gridlist_count_p, PJ_GRIDINFO **tables, struct CTABLE *ct) {
+static double read_vgrid_value( PJ *defn, PJ_LP input, int *gridlist_count_p, PJ_GRIDINFO **tables, struct CTABLE *ct) {
int itable = 0;
double value = HUGE_VAL;
double grid_x, grid_y;
@@ -213,7 +213,7 @@ int pj_apply_vgridshift( PJ *defn, const char *listname,
{
double value;
long io = i * point_offset;
- LP input;
+ PJ_LP input;
input.phi = y[io];
input.lam = x[io];
@@ -310,7 +310,7 @@ int proj_vgrid_init(PJ* P, const char *grids) {
}
/***********************************************/
-double proj_vgrid_value(PJ *P, LP lp){
+double proj_vgrid_value(PJ *P, PJ_LP lp){
/***********************************************
Read grid value at position lp in grids loaded
diff --git a/src/apps/cs2cs.cpp b/src/apps/cs2cs.cpp
index 937d3d58..9000454a 100644
--- a/src/apps/cs2cs.cpp
+++ b/src/apps/cs2cs.cpp
@@ -83,7 +83,7 @@ static void process(FILE *fid)
{
char line[MAX_LINE + 3], *s, pline[40];
- projUV data;
+ PJ_UV data;
for (;;) {
double z;
diff --git a/src/apps/gen_cheb.cpp b/src/apps/gen_cheb.cpp
index 4ba514d4..167ee79d 100644
--- a/src/apps/gen_cheb.cpp
+++ b/src/apps/gen_cheb.cpp
@@ -1,5 +1,6 @@
/* generates 'T' option output */
#define PJ_LIB__
+#include "proj.h"
#include "projects.h"
#include <stdio.h>
#include <string.h>
@@ -38,17 +39,17 @@ static long strtol_type_safe(const char *s, const char ** endptr, int base)
/* FIXME: put the declaration in a header. Also used in proj.c */
-void gen_cheb(int inverse, projUV (*proj)(projUV), const char *s, PJ *P,
+void gen_cheb(int inverse, PJ_UV (*proj)(PJ_UV), const char *s, PJ *P,
int iargc, char **iargv);
extern void p_series(Tseries *, FILE *, char *);
-void gen_cheb(int inverse, projUV (*proj)(projUV), const char *s, PJ *P,
+void gen_cheb(int inverse, PJ_UV (*proj)(PJ_UV), const char *s, PJ *P,
int iargc, char **iargv) {
long NU = 15, NV = 15;
int errin = 0, pwr;
long res = -1;
char *arg, fmt[32];
- projUV low, upp, resid;
+ PJ_UV low, upp, resid;
Tseries *F;
double (*input)(const char *, const char **);
diff --git a/src/apps/geod_interface.cpp b/src/apps/geod_interface.cpp
index a30377ac..1a085b38 100644
--- a/src/apps/geod_interface.cpp
+++ b/src/apps/geod_interface.cpp
@@ -1,3 +1,4 @@
+#include "proj.h"
#include "projects.h"
#include "geod_interface.h"
diff --git a/src/apps/nad2bin.cpp b/src/apps/nad2bin.cpp
index ff8f2ebd..62a7b320 100644
--- a/src/apps/nad2bin.cpp
+++ b/src/apps/nad2bin.cpp
@@ -274,7 +274,7 @@ int main(int argc, char **argv) {
unsigned char achHeader[11*16];
double dfValue;
pj_int32 nGSCount = ct.lim.lam * ct.lim.phi;
- LP ur;
+ PJ_LP ur;
ur.lam = ct.ll.lam + (ct.lim.lam-1) * ct.del.lam;
ur.phi = ct.ll.phi + (ct.lim.phi-1) * ct.del.phi;
diff --git a/src/apps/p_series.cpp b/src/apps/p_series.cpp
index cddea888..3815824b 100644
--- a/src/apps/p_series.cpp
+++ b/src/apps/p_series.cpp
@@ -1,4 +1,5 @@
/* print row coefficients of Tseries structure */
+#include "proj.h"
#include "projects.h"
#include <stdio.h>
#include <string.h>
diff --git a/src/apps/proj.cpp b/src/apps/proj.cpp
index b93fb04d..9958a777 100644
--- a/src/apps/proj.cpp
+++ b/src/apps/proj.cpp
@@ -20,13 +20,13 @@
#define MAX_PARGS 100
#define PJ_INVERS(P) (P->inv ? 1 : 0)
-extern void gen_cheb(int, projUV(*)(projUV), const char *, PJ *, int, char **);
+extern void gen_cheb(int, PJ_UV(*)(PJ_UV), const char *, PJ *, int, char **);
static PJ *Proj;
static union {
- projUV (*generic)(projUV, PJ *);
- projXY (*fwd)(projLP, PJ *);
- projLP (*inv)(projXY, PJ *);
+ PJ_UV (*generic)(PJ_UV, PJ *);
+ PJ_XY (*fwd)(PJ_LP, PJ *);
+ PJ_LP (*inv)(PJ_XY, PJ *);
} proj;
static int
@@ -56,7 +56,7 @@ static PJ_FACTORS facs;
static double (*informat)(const char *, char **), /* input data deformatter function */
fscale = 0.; /* cartesian scale factor */
-static projUV int_proj(projUV data) {
+static PJ_UV int_proj(PJ_UV data) {
if (prescale) {
data.u *= fscale;
data.v *= fscale;
@@ -82,7 +82,7 @@ static void process(FILE *fid) {
++emess_dat.File_line;
if (bin_in) { /* binary input */
- if (fread(&data, sizeof(projUV), 1, fid) != 1)
+ if (fread(&data, sizeof(PJ_UV), 1, fid) != 1)
break;
} else { /* ascii input */
if (!(s = fgets(line, MAX_LINE, fid)))
@@ -144,7 +144,7 @@ static void process(FILE *fid) {
}
if (bin_out) { /* binary output */
- (void)fwrite(&data, sizeof(projUV), 1, stdout);
+ (void)fwrite(&data, sizeof(PJ_UV), 1, stdout);
continue;
} else if (data.uv.u == HUGE_VAL) /* error output */
(void)fputs(oterr, stdout);
@@ -196,8 +196,8 @@ static void process(FILE *fid) {
/* file processing function --- verbosely */
static void vprocess(FILE *fid) {
char line[MAX_LINE+3], *s, pline[40];
- LP dat_ll;
- projXY dat_xy;
+ PJ_LP dat_ll;
+ PJ_XY dat_xy;
int linvers;
PJ_COORD coord;
@@ -247,7 +247,7 @@ static void vprocess(FILE *fid) {
}
if (prescale) { dat_xy.x *= fscale; dat_xy.y *= fscale; }
if (reversein) {
- projXY temp = dat_xy;
+ PJ_XY temp = dat_xy;
dat_xy.x = temp.y;
dat_xy.y = temp.x;
}
@@ -260,7 +260,7 @@ static void vprocess(FILE *fid) {
continue;
}
if (reversein) {
- LP temp = dat_ll;
+ PJ_LP temp = dat_ll;
dat_ll.lam = temp.phi;
dat_ll.phi = temp.lam;
}
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp
index d604365a..589ca832 100644
--- a/src/apps/projinfo.cpp
+++ b/src/apps/projinfo.cpp
@@ -35,6 +35,7 @@
#include <iostream>
#include <utility>
+#include "proj.h"
#include "projects.h"
#include <proj/common.hpp>
diff --git a/src/auth.cpp b/src/auth.cpp
index cde60a29..3da63c60 100644
--- a/src/auth.cpp
+++ b/src/auth.cpp
@@ -3,6 +3,7 @@
#include <math.h>
#include <stddef.h>
+#include "proj.h"
#include "projects.h"
# define P00 .33333333333333333333 /* 1 / 3 */
diff --git a/src/bch2bps.cpp b/src/bch2bps.cpp
index 3ee56993..1812ee2b 100644
--- a/src/bch2bps.cpp
+++ b/src/bch2bps.cpp
@@ -1,41 +1,43 @@
/* convert bivariate w Chebyshev series to w Power series */
+
+#include "proj.h"
#include "projects.h"
/* basic support procedures */
static void /* clear vector to zero */
-clear(projUV *p, int n) { static const projUV c = {0., 0.}; while (n--) *p++ = c; }
+clear(PJ_UV *p, int n) { static const PJ_UV c = {0., 0.}; while (n--) *p++ = c; }
static void /* clear matrix rows to zero */
-bclear(projUV **p, int n, int m) { while (n--) clear(*p++, m); }
+bclear(PJ_UV **p, int n, int m) { while (n--) clear(*p++, m); }
static void /* move vector */
-bmove(projUV *a, projUV *b, int n) { while (n--) *a++ = *b++; }
+bmove(PJ_UV *a, PJ_UV *b, int n) { while (n--) *a++ = *b++; }
static void /* a <- m * b - c */
-submop(projUV *a, double m, projUV *b, projUV *c, int n) {
+submop(PJ_UV *a, double m, PJ_UV *b, PJ_UV *c, int n) {
while (n--) {
a->u = m * b->u - c->u;
a++->v = m * b++->v - c++->v;
}
}
static void /* a <- b - c */
-subop(projUV *a, projUV *b, projUV *c, int n) {
+subop(PJ_UV *a, PJ_UV *b, PJ_UV *c, int n) {
while (n--) {
a->u = b->u - c->u;
a++->v = b++->v - c++->v;
}
}
static void /* multiply vector a by scalar m */
-dmult(projUV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
+dmult(PJ_UV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
static void /* row adjust a[] <- a[] - m * b[] */
-dadd(projUV *a, projUV *b, double m, int n) {
+dadd(PJ_UV *a, PJ_UV *b, double m, int n) {
while(n--) {
a->u -= m * b->u;
a++->v -= m * b++->v;
}
}
static int /* convert row to power series */
-rows(projUV *c, projUV *d, int n) {
- projUV sv, *dd;
+rows(PJ_UV *c, PJ_UV *d, int n) {
+ PJ_UV sv, *dd;
int j, k;
- dd = (projUV *)vector1(n-1, sizeof(projUV));
+ dd = (PJ_UV *)vector1(n-1, sizeof(PJ_UV));
if (!dd)
return 0;
sv.u = sv.v = 0.;
@@ -63,14 +65,14 @@ rows(projUV *c, projUV *d, int n) {
return 1;
}
static int /* convert columns to power series */
-cols(projUV **c, projUV **d, int nu, int nv) {
- projUV *sv, **dd;
+cols(PJ_UV **c, PJ_UV **d, int nu, int nv) {
+ PJ_UV *sv, **dd;
int j, k;
- dd = (projUV **)vector2(nu, nv, sizeof(projUV));
+ dd = (PJ_UV **)vector2(nu, nv, sizeof(PJ_UV));
if (!dd)
return 0;
- sv = (projUV *)vector1(nv, sizeof(projUV));
+ sv = (PJ_UV *)vector1(nv, sizeof(PJ_UV));
if (!sv) {
freev2((void **)dd, nu);
return 0;
@@ -96,7 +98,7 @@ cols(projUV **c, projUV **d, int nu, int nv) {
return 1;
}
static void /* row adjust for range -1 to 1 to a to b */
-rowshft(double a, double b, projUV *d, int n) {
+rowshft(double a, double b, PJ_UV *d, int n) {
int k, j;
double fac, cnst;
@@ -115,7 +117,7 @@ rowshft(double a, double b, projUV *d, int n) {
}
}
static void /* column adjust for range -1 to 1 to a to b */
-colshft(double a, double b, projUV **d, int n, int m) {
+colshft(double a, double b, PJ_UV **d, int n, int m) {
int k, j;
double fac, cnst;
@@ -131,11 +133,11 @@ colshft(double a, double b, projUV **d, int n, int m) {
dadd(d[k], d[k+1], cnst, m);
}
int /* entry point */
-bch2bps(projUV a, projUV b, projUV **c, int nu, int nv) {
- projUV **d;
+bch2bps(PJ_UV a, PJ_UV b, PJ_UV **c, int nu, int nv) {
+ PJ_UV **d;
int i;
- if (nu < 1 || nv < 1 || !(d = (projUV **)vector2(nu, nv, sizeof(projUV))))
+ if (nu < 1 || nv < 1 || !(d = (PJ_UV **)vector2(nu, nv, sizeof(PJ_UV))))
return 0;
/* do rows to power series */
for (i = 0; i < nu; ++i) {
diff --git a/src/bchgen.cpp b/src/bchgen.cpp
index c129f0c1..324ac8f6 100644
--- a/src/bchgen.cpp
+++ b/src/bchgen.cpp
@@ -1,9 +1,10 @@
/* generate double bivariate Chebychev polynomial */
+#include "proj.h"
#include "projects.h"
int
-bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
+bchgen(PJ_UV a, PJ_UV b, int nu, int nv, PJ_UV **f, PJ_UV(*func)(PJ_UV)) {
int i, j, k;
- projUV arg, *t, bma, bpa, *c;
+ PJ_UV arg, *t, bma, bpa, *c;
double d, fac;
bma.u = 0.5 * (b.u - a.u); bma.v = 0.5 * (b.v - a.v);
@@ -17,7 +18,7 @@ bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
return(1);
}
}
- if (!(c = (projUV *) vector1(nu, sizeof(projUV)))) return 1;
+ if (!(c = (PJ_UV *) vector1(nu, sizeof(PJ_UV)))) return 1;
fac = 2. / nu;
for ( j = 0; j < nv ; ++j) {
for ( i = 0; i < nu; ++i) {
@@ -35,7 +36,7 @@ bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
f[i][j] = c[i];
}
pj_dalloc(c);
- if (!(c = (projUV*) vector1(nv, sizeof(projUV)))) return 1;
+ if (!(c = (PJ_UV*) vector1(nv, sizeof(PJ_UV)))) return 1;
fac = 2. / nv;
for ( i = 0; i < nu; ++i) {
t = f[i];
diff --git a/src/biveval.cpp b/src/biveval.cpp
index 05e83e21..219534c3 100644
--- a/src/biveval.cpp
+++ b/src/biveval.cpp
@@ -1,7 +1,8 @@
/* procedures for evaluating Tseries */
+#include "proj.h"
# include "projects.h"
# define NEAR_ONE 1.00001
-static double ceval(struct PW_COEF *C, int n, projUV w, projUV w2) {
+static double ceval(struct PW_COEF *C, int n, PJ_UV w, PJ_UV w2) {
double d=0, dd=0, vd, vdd, tmp, *c;
int j;
@@ -28,10 +29,10 @@ static double ceval(struct PW_COEF *C, int n, projUV w, projUV w2) {
return (w.u * d - dd);
}
-projUV /* bivariate Chebyshev polynomial entry point */
-bcheval(projUV in, Tseries *T) {
- projUV w2, w;
- projUV out;
+PJ_UV /* bivariate Chebyshev polynomial entry point */
+bcheval(PJ_UV in, Tseries *T) {
+ PJ_UV w2, w;
+ PJ_UV out;
/* scale to +-1 */
w.u = ( in.u + in.u - T->a.u ) * T->b.u;
w.v = ( in.v + in.v - T->a.v ) * T->b.v;
@@ -47,9 +48,9 @@ bcheval(projUV in, Tseries *T) {
return out;
}
-projUV /* bivariate power polynomial entry point */
-bpseval(projUV in, Tseries *T) {
- projUV out;
+PJ_UV /* bivariate power polynomial entry point */
+bpseval(PJ_UV in, Tseries *T) {
+ PJ_UV out;
double *c, row;
int i, m;
@@ -75,8 +76,8 @@ bpseval(projUV in, Tseries *T) {
return out;
}
-projUV /* general entry point selecting evaluation mode */
-biveval(projUV in, Tseries *T) {
+PJ_UV /* general entry point selecting evaluation mode */
+biveval(PJ_UV in, Tseries *T) {
if (T->power) {
return bpseval(in, T);
diff --git a/src/conversions/axisswap.cpp b/src/conversions/axisswap.cpp
index 8714ec85..f9dd4fa5 100644
--- a/src/conversions/axisswap.cpp
+++ b/src/conversions/axisswap.cpp
@@ -57,6 +57,7 @@ operation:
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "proj_internal.h"
#include "projects.h"
@@ -73,7 +74,7 @@ static int sign(int x) {
return (x > 0) - (x < 0);
}
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD out, in;
@@ -88,7 +89,7 @@ static XY forward_2d(LP lp, PJ *P) {
}
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD out, in;
@@ -103,7 +104,7 @@ static LP reverse_2d(XY xy, PJ *P) {
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD out, in;
@@ -117,7 +118,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
return out.xyz;
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD in, out;
diff --git a/src/conversions/cart.cpp b/src/conversions/cart.cpp
index 6fed9985..bcfbb5e6 100644
--- a/src/conversions/cart.cpp
+++ b/src/conversions/cart.cpp
@@ -131,10 +131,10 @@ static double geocentric_radius (double a, double b, double phi) {
/*********************************************************************/
-static XYZ cartesian (LPZ geod, PJ *P) {
+static PJ_XYZ cartesian (PJ_LPZ geod, PJ *P) {
/*********************************************************************/
double N, cosphi = cos(geod.phi);
- XYZ xyz;
+ PJ_XYZ xyz;
N = normal_radius_of_curvature(P->a, P->es, geod.phi);
@@ -148,10 +148,10 @@ static XYZ cartesian (LPZ geod, PJ *P) {
/*********************************************************************/
-static LPZ geodetic (XYZ cart, PJ *P) {
+static PJ_LPZ geodetic (PJ_XYZ cart, PJ *P) {
/*********************************************************************/
double N, p, theta, c, s;
- LPZ lpz;
+ PJ_LPZ lpz;
/* Perpendicular distance from point to Z-axis (HM eq. 5-28) */
p = hypot (cart.x, cart.y);
@@ -185,7 +185,7 @@ static LPZ geodetic (XYZ cart, PJ *P) {
/* In effect, 2 cartesian coordinates of a point on the ellipsoid. Rather pointless, but... */
-static XY cart_forward (LP lp, PJ *P) {
+static PJ_XY cart_forward (PJ_LP lp, PJ *P) {
PJ_COORD point;
point.lp = lp;
point.lpz.z = 0;
@@ -195,7 +195,7 @@ static XY cart_forward (LP lp, PJ *P) {
}
/* And the other way round. Still rather pointless, but... */
-static LP cart_reverse (XY xy, PJ *P) {
+static PJ_LP cart_reverse (PJ_XY xy, PJ *P) {
PJ_COORD point;
point.xy = xy;
point.xyz.z = 0;
diff --git a/src/conversions/geocent.cpp b/src/conversions/geocent.cpp
index 0e9d725e..d5f3e075 100644
--- a/src/conversions/geocent.cpp
+++ b/src/conversions/geocent.cpp
@@ -28,20 +28,22 @@
*****************************************************************************/
#define PJ_LIB__
+
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(geocent, "Geocentric") "\n\t";
-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};
(void) P;
xy.x = lp.lam;
xy.y = lp.phi;
return xy;
}
-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};
(void) P;
lp.phi = xy.y;
lp.lam = xy.x;
diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp
index b25fd5d2..10c56344 100644
--- a/src/conversions/unitconvert.cpp
+++ b/src/conversions/unitconvert.cpp
@@ -281,7 +281,7 @@ static const struct TIME_UNITS time_units[] = {
/***********************************************************************/
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
/************************************************************************
Forward unit conversions in the plane
************************************************************************/
@@ -297,7 +297,7 @@ static XY forward_2d(LP lp, PJ *P) {
/***********************************************************************/
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
/************************************************************************
Reverse unit conversions in the plane
************************************************************************/
@@ -313,7 +313,7 @@ static LP reverse_2d(XY xy, PJ *P) {
/***********************************************************************/
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
/************************************************************************
Forward unit conversions the vertical component
************************************************************************/
@@ -330,7 +330,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
}
/***********************************************************************/
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
/************************************************************************
Reverse unit conversions the vertical component
************************************************************************/
diff --git a/src/deriv.cpp b/src/deriv.cpp
index 72a69440..3839809e 100644
--- a/src/deriv.cpp
+++ b/src/deriv.cpp
@@ -6,8 +6,8 @@
#include "proj.h"
#include "projects.h"
-int pj_deriv(LP lp, double h, const PJ *P, struct DERIVS *der) {
- XY t;
+int pj_deriv(PJ_LP lp, double h, const PJ *P, struct DERIVS *der) {
+ PJ_XY t;
/* get rid of constness until we can do it for real */
PJ *Q = (PJ *) P;
if (nullptr==Q->fwd)
diff --git a/src/dmstor.cpp b/src/dmstor.cpp
index 967a9f18..bffebc9c 100644
--- a/src/dmstor.cpp
+++ b/src/dmstor.cpp
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
static double proj_strtod(char *nptr, char **endptr);
diff --git a/src/errno.cpp b/src/errno.cpp
index f6ea9bfc..f948a945 100644
--- a/src/errno.cpp
+++ b/src/errno.cpp
@@ -1,5 +1,6 @@
/* For full ANSI compliance of global variable */
+#include "proj.h"
#include "projects.h"
int pj_errno = 0;
diff --git a/src/factors.cpp b/src/factors.cpp
index 768bf585..76b0d4e6 100644
--- a/src/factors.cpp
+++ b/src/factors.cpp
@@ -13,7 +13,7 @@
#define EPS 1.0e-12
-int pj_factors(LP lp, const PJ *P, double h, struct FACTORS *fac) {
+int pj_factors(PJ_LP lp, const PJ *P, double h, struct FACTORS *fac) {
double cosphi, t, n, r;
int err;
PJ_COORD coo = {{0, 0, 0, 0}};
diff --git a/src/fileapi.cpp b/src/fileapi.cpp
index 3df73236..c9e986e5 100644
--- a/src/fileapi.cpp
+++ b/src/fileapi.cpp
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
static PAFile stdio_fopen(projCtx ctx, const char *filename,
diff --git a/src/fwd.cpp b/src/fwd.cpp
index e8f73999..2824a039 100644
--- a/src/fwd.cpp
+++ b/src/fwd.cpp
@@ -164,7 +164,7 @@ static PJ_COORD error_or_coord(PJ *P, PJ_COORD coord, int last_errno) {
}
-XY pj_fwd(LP lp, PJ *P) {
+PJ_XY pj_fwd(PJ_LP lp, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.lp = lp;
@@ -198,7 +198,7 @@ XY pj_fwd(LP lp, PJ *P) {
-XYZ pj_fwd3d(LPZ lpz, PJ *P) {
+PJ_XYZ pj_fwd3d(PJ_LPZ lpz, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.lpz = lpz;
diff --git a/src/gauss.cpp b/src/gauss.cpp
index 2db713ad..d7354bdc 100644
--- a/src/gauss.cpp
+++ b/src/gauss.cpp
@@ -28,6 +28,7 @@
#include <math.h>
#include <stdlib.h>
+#include "proj.h"
#include "projects.h"
#define MAX_ITER 20
@@ -70,9 +71,9 @@ void *pj_gauss_ini(double e, double phi0, double *chi, double *rc) {
return ((void *)en);
}
-LP pj_gauss(projCtx ctx, LP elp, const void *data) {
+PJ_LP pj_gauss(projCtx ctx, PJ_LP elp, const void *data) {
const struct GAUSS *en = (const struct GAUSS *)data;
- LP slp;
+ PJ_LP slp;
(void) ctx;
slp.phi = 2. * atan( en->K *
@@ -82,9 +83,9 @@ LP pj_gauss(projCtx ctx, LP elp, const void *data) {
return(slp);
}
-LP pj_inv_gauss(projCtx ctx, LP slp, const void *data) {
+PJ_LP pj_inv_gauss(projCtx ctx, PJ_LP slp, const void *data) {
const struct GAUSS *en = (const struct GAUSS *)data;
- LP elp;
+ PJ_LP elp;
double num;
int i;
diff --git a/src/gc_reader.cpp b/src/gc_reader.cpp
index 118aadf6..094aa44c 100644
--- a/src/gc_reader.cpp
+++ b/src/gc_reader.cpp
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
static int gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry);
diff --git a/src/gridcatalog.cpp b/src/gridcatalog.cpp
index 8fb90efa..18f93b4e 100644
--- a/src/gridcatalog.cpp
+++ b/src/gridcatalog.cpp
@@ -123,7 +123,7 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
for( i = 0; i < point_count; i++ )
{
long io = i * point_offset;
- LP input, output_after, output_before;
+ PJ_LP input, output_after, output_before;
double mix_ratio;
PJ_GRIDINFO *gi;
@@ -237,7 +237,7 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
/************************************************************************/
PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, PJ_GridCatalog *catalog, int after,
- LP location, double date,
+ PJ_LP location, double date,
PJ_Region *optional_region,
double *grid_date )
{
diff --git a/src/gridinfo.cpp b/src/gridinfo.cpp
index 046abfcc..041de935 100644
--- a/src/gridinfo.cpp
+++ b/src/gridinfo.cpp
@@ -483,7 +483,7 @@ static int pj_gridinfo_init_ntv2( projCtx ctx, PAFile fid, PJ_GRIDINFO *gilist )
for( subfile = 0; subfile < num_subfiles; subfile++ )
{
struct CTABLE *ct;
- LP ur;
+ PJ_LP ur;
int gs_count;
PJ_GRIDINFO *gi;
@@ -662,7 +662,7 @@ static int pj_gridinfo_init_ntv1( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
{
unsigned char header[192]; /* 12 records of 16 bytes */
struct CTABLE *ct;
- LP ur;
+ PJ_LP ur;
/* cppcheck-suppress sizeofCalculation */
STATIC_ASSERT( sizeof(pj_int32) == 4 );
diff --git a/src/gridlist.cpp b/src/gridlist.cpp
index 169abcb9..41f4e2c5 100644
--- a/src/gridlist.cpp
+++ b/src/gridlist.cpp
@@ -32,6 +32,7 @@
#include <stddef.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
static PJ_GRIDINFO *grid_list = nullptr;
diff --git a/src/initcache.cpp b/src/initcache.cpp
index 052a016c..4d1d8695 100644
--- a/src/initcache.cpp
+++ b/src/initcache.cpp
@@ -27,6 +27,7 @@
#include <string.h>
+#include "proj.h"
#include "projects.h"
static int cache_count = 0;
diff --git a/src/inv.cpp b/src/inv.cpp
index ba7e6722..8ce5dfcd 100644
--- a/src/inv.cpp
+++ b/src/inv.cpp
@@ -141,7 +141,7 @@ static PJ_COORD error_or_coord(PJ *P, PJ_COORD coord, int last_errno) {
}
-LP pj_inv(XY xy, PJ *P) {
+PJ_LP pj_inv(PJ_XY xy, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.xy = xy;
@@ -175,7 +175,7 @@ LP pj_inv(XY xy, PJ *P) {
-LPZ pj_inv3d (XYZ xyz, PJ *P) {
+PJ_LPZ pj_inv3d (PJ_XYZ xyz, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.xyz = xyz;
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index e9a9f434..6b6651da 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -41,7 +41,11 @@
#include "proj/internal/internal.hpp"
#include "proj/internal/io_internal.hpp"
+// PROJ include order is sensitive
+// clang-format off
+#include "proj.h"
#include "projects.h" // M_PI
+// clang-format on
#include <algorithm>
#include <cassert>
diff --git a/src/mk_cheby.cpp b/src/mk_cheby.cpp
index 5e6bfef0..62528a41 100644
--- a/src/mk_cheby.cpp
+++ b/src/mk_cheby.cpp
@@ -1,9 +1,10 @@
+#include "proj.h"
#include "projects.h"
static void /* sum coefficients less than res */
-eval(projUV **w, int nu, int nv, double res, projUV *resid) {
+eval(PJ_UV **w, int nu, int nv, double res, PJ_UV *resid) {
int i, j;
double ab;
- projUV *s;
+ PJ_UV *s;
resid->u = resid->v = 0.;
for (i = 0; i < nu; ++i) {
@@ -41,14 +42,14 @@ makeT(int nru, int nrv) {
return T;
}
Tseries *
-mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
+mk_cheby(PJ_UV a, PJ_UV b, double res, PJ_UV *resid, PJ_UV (*func)(PJ_UV),
int nu, int nv, int power) {
int j, i, nru, nrv, *ncu, *ncv;
Tseries *T = nullptr;
- projUV **w;
+ PJ_UV **w;
double cutres;
- if (!(w = (projUV **)vector2(nu, nv, sizeof(projUV))))
+ if (!(w = (PJ_UV **)vector2(nu, nv, sizeof(PJ_UV))))
return nullptr;
if (!(ncu = (int *)vector1(nu + nv, sizeof(int)))) {
freev2((void **)w, nu);
@@ -56,7 +57,7 @@ mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
}
ncv = ncu + nu;
if (!bchgen(a, b, nu, nv, w, func)) {
- projUV *s;
+ PJ_UV *s;
double ab, *p;
/* analyse coefficients and adjust until residual OK */
diff --git a/src/mlfn.cpp b/src/mlfn.cpp
index e032e642..e6bbd152 100644
--- a/src/mlfn.cpp
+++ b/src/mlfn.cpp
@@ -1,5 +1,6 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
/* meridional distance for ellipsoid and inverse
diff --git a/src/msfn.cpp b/src/msfn.cpp
index 999e73a7..cf6accf1 100644
--- a/src/msfn.cpp
+++ b/src/msfn.cpp
@@ -1,5 +1,6 @@
/* determine constant small m */
#include <math.h>
+#include "proj.h"
#include "projects.h"
double
pj_msfn(double sinphi, double cosphi, double es) {
diff --git a/src/mutex.cpp b/src/mutex.cpp
index 3752324c..857c8bb4 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -38,6 +38,7 @@
#define _GNU_SOURCE
#endif
+#include "proj.h"
#ifndef _WIN32
#include "proj_config.h"
#include "projects.h"
diff --git a/src/nad_cvt.cpp b/src/nad_cvt.cpp
index c0e67943..91615bfa 100644
--- a/src/nad_cvt.cpp
+++ b/src/nad_cvt.cpp
@@ -10,8 +10,8 @@
#define MAX_ITERATIONS 10
#define TOL 1e-12
-LP nad_cvt(LP in, int inverse, struct CTABLE *ct) {
- LP t, tb,del, dif;
+PJ_LP nad_cvt(PJ_LP in, int inverse, struct CTABLE *ct) {
+ PJ_LP t, tb,del, dif;
int i = MAX_ITERATIONS;
const double toltol = TOL*TOL;
diff --git a/src/nad_init.cpp b/src/nad_init.cpp
index 1e2b150d..695fa973 100644
--- a/src/nad_init.cpp
+++ b/src/nad_init.cpp
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
/************************************************************************/
diff --git a/src/nad_intr.cpp b/src/nad_intr.cpp
index b5f61db7..92d3292b 100644
--- a/src/nad_intr.cpp
+++ b/src/nad_intr.cpp
@@ -5,9 +5,8 @@
#include "proj.h"
#include "projects.h"
- LP
-nad_intr(LP t, struct CTABLE *ct) {
- LP val, frct;
+PJ_LP nad_intr(PJ_LP t, struct CTABLE *ct) {
+ PJ_LP val, frct;
ILP indx;
double m00, m10, m01, m11;
FLP *f00, *f10, *f01, *f11;
diff --git a/src/param.cpp b/src/param.cpp
index 74247b72..22d21cf4 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -6,6 +6,7 @@
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
/* create parameter list entry */
diff --git a/src/phi2.cpp b/src/phi2.cpp
index a83302e6..1f7b0846 100644
--- a/src/phi2.cpp
+++ b/src/phi2.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
static const double TOL = 1.0e-10;
diff --git a/src/pipeline.cpp b/src/pipeline.cpp
index 76fc58a5..23d8f969 100644
--- a/src/pipeline.cpp
+++ b/src/pipeline.cpp
@@ -122,10 +122,10 @@ struct pj_opaque {
static PJ_COORD pipeline_forward_4d (PJ_COORD point, PJ *P);
static PJ_COORD pipeline_reverse_4d (PJ_COORD point, PJ *P);
-static XYZ pipeline_forward_3d (LPZ lpz, PJ *P);
-static LPZ pipeline_reverse_3d (XYZ xyz, PJ *P);
-static XY pipeline_forward (LP lp, PJ *P);
-static LP pipeline_reverse (XY xy, PJ *P);
+static PJ_XYZ pipeline_forward_3d (PJ_LPZ lpz, PJ *P);
+static PJ_LPZ pipeline_reverse_3d (PJ_XYZ xyz, PJ *P);
+static PJ_XY pipeline_forward (PJ_LP lp, PJ *P);
+static PJ_LP pipeline_reverse (PJ_XY xy, PJ *P);
@@ -158,7 +158,7 @@ static PJ_COORD pipeline_reverse_4d (PJ_COORD point, PJ *P) {
-static XYZ pipeline_forward_3d (LPZ lpz, PJ *P) {
+static PJ_XYZ pipeline_forward_3d (PJ_LPZ lpz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.lpz = lpz;
@@ -170,7 +170,7 @@ static XYZ pipeline_forward_3d (LPZ lpz, PJ *P) {
}
-static LPZ pipeline_reverse_3d (XYZ xyz, PJ *P) {
+static PJ_LPZ pipeline_reverse_3d (PJ_XYZ xyz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.xyz = xyz;
@@ -184,7 +184,7 @@ static LPZ pipeline_reverse_3d (XYZ xyz, PJ *P) {
-static XY pipeline_forward (LP lp, PJ *P) {
+static PJ_XY pipeline_forward (PJ_LP lp, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.lp = lp;
@@ -196,7 +196,7 @@ static XY pipeline_forward (LP lp, PJ *P) {
}
-static LP pipeline_reverse (XY xy, PJ *P) {
+static PJ_LP pipeline_reverse (PJ_XY xy, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.xy = xy;
diff --git a/src/pr_list.cpp b/src/pr_list.cpp
index b8ad2c04..2ff91332 100644
--- a/src/pr_list.cpp
+++ b/src/pr_list.cpp
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
#define LINE_LEN 72
diff --git a/src/proj_mdist.cpp b/src/proj_mdist.cpp
index e3f0f5c6..e7acedcc 100644
--- a/src/proj_mdist.cpp
+++ b/src/proj_mdist.cpp
@@ -32,6 +32,7 @@
#include <math.h>
#include <stdlib.h>
+#include "proj.h"
#include "projects.h"
#define MAX_ITER 20
diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp
index c4a4a72a..2b7f7238 100644
--- a/src/projections/aea.cpp
+++ b/src/projections/aea.cpp
@@ -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..f92ecd81 100644
--- a/src/projections/aeqd.cpp
+++ b/src/projections/aeqd.cpp
@@ -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..9421edc9 100644
--- a/src/projections/airy.cpp
+++ b/src/projections/airy.cpp
@@ -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..9388b75a 100644
--- a/src/projections/aitoff.cpp
+++ b/src/projections/aitoff.cpp
@@ -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..f7c24e3a 100644
--- a/src/projections/august.cpp
+++ b/src/projections/august.cpp
@@ -2,14 +2,15 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..74337ff2 100644
--- a/src/projections/bacon.cpp
+++ b/src/projections/bacon.cpp
@@ -4,6 +4,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
@@ -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..41301e7d 100644
--- a/src/projections/bertin1953.cpp
+++ b/src/projections/bertin1953.cpp
@@ -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..d0b77092 100644
--- a/src/projections/bipc.cpp
+++ b/src/projections/bipc.cpp
@@ -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..df5afbd2 100644
--- a/src/projections/boggs.cpp
+++ b/src/projections/boggs.cpp
@@ -1,6 +1,7 @@
#define PJ_LIB__
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl, no inv, Sph";
@@ -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..2004c6e9 100644
--- a/src/projections/bonne.cpp
+++ b/src/projections/bonne.cpp
@@ -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..2ca79553 100644
--- a/src/projections/calcofi.cpp
+++ b/src/projections/calcofi.cpp
@@ -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..7afa2bd8 100644
--- a/src/projections/cass.cpp
+++ b/src/projections/cass.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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..7ac886f0 100644
--- a/src/projections/cc.cpp
+++ b/src/projections/cc.cpp
@@ -9,8 +9,8 @@ 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..4513a6f9 100644
--- a/src/projections/ccon.cpp
+++ b/src/projections/ccon.cpp
@@ -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..4abb5543 100644
--- a/src/projections/cea.cpp
+++ b/src/projections/cea.cpp
@@ -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..c62e35f1 100644
--- a/src/projections/chamb.cpp
+++ b/src/projections/chamb.cpp
@@ -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..5f4de7c6 100644
--- a/src/projections/collg.cpp
+++ b/src/projections/collg.cpp
@@ -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..dd0ce5c0 100644
--- a/src/projections/comill.cpp
+++ b/src/projections/comill.cpp
@@ -10,6 +10,7 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016
#include <math.h>
+#include "proj.h"
#include "projects.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..76846dbe 100644
--- a/src/projections/crast.cpp
+++ b/src/projections/crast.cpp
@@ -1,6 +1,7 @@
#define PJ_LIB__
#include <math.h>
+#include "proj.h"
#include "projects.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..d10d8881 100644
--- a/src/projections/denoy.cpp
+++ b/src/projections/denoy.cpp
@@ -1,6 +1,7 @@
#define PJ_LIB__
#include <math.h>
+#include "proj.h"
#include "projects.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..d8dbc2c5 100644
--- a/src/projections/eck1.cpp
+++ b/src/projections/eck1.cpp
@@ -1,6 +1,7 @@
#define PJ_LIB__
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl, Sph";
@@ -8,8 +9,8 @@ PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl, Sph";
#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..efedf8b7 100644
--- a/src/projections/eck2.cpp
+++ b/src/projections/eck2.cpp
@@ -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..71163083 100644
--- a/src/projections/eck3.cpp
+++ b/src/projections/eck3.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(eck3, "Eckert III") "\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..64a1158f 100644
--- a/src/projections/eck4.cpp
+++ b/src/projections/eck4.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..ab207aab 100644
--- a/src/projections/eck5.cpp
+++ b/src/projections/eck5.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..f7a0eede 100644
--- a/src/projections/eqc.cpp
+++ b/src/projections/eqc.cpp
@@ -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..1aa037a6 100644
--- a/src/projections/eqdc.cpp
+++ b/src/projections/eqdc.cpp
@@ -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..96ea46ba 100644
--- a/src/projections/eqearth.cpp
+++ b/src/projections/eqearth.cpp
@@ -16,6 +16,7 @@ Added ellipsoidal equations by Bojan Savric, 22 August 2018
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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..9b75c606 100644
--- a/src/projections/etmerc.cpp
+++ b/src/projections/etmerc.cpp
@@ -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..bcce7eef 100644
--- a/src/projections/fahey.cpp
+++ b/src/projections/fahey.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(fahey, "Fahey") "\n\tPcyl, Sph";
@@ -9,8 +10,8 @@ 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..08db782e 100644
--- a/src/projections/fouc_s.cpp
+++ b/src/projections/fouc_s.cpp
@@ -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..d3eba43c 100644
--- a/src/projections/gall.cpp
+++ b/src/projections/gall.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..1e6c2d69 100644
--- a/src/projections/geos.cpp
+++ b/src/projections/geos.cpp
@@ -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..a8539db4 100644
--- a/src/projections/gins8.cpp
+++ b/src/projections/gins8.cpp
@@ -1,4 +1,6 @@
#define PJ_LIB__
+
+#include "proj.h"
#include "projects.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..f301e05c 100644
--- a/src/projections/gn_sinu.cpp
+++ b/src/projections/gn_sinu.cpp
@@ -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..513d9b42 100644
--- a/src/projections/gnom.cpp
+++ b/src/projections/gnom.cpp
@@ -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..2717a424 100644
--- a/src/projections/goode.cpp
+++ b/src/projections/goode.cpp
@@ -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..69087228 100644
--- a/src/projections/gstmerc.cpp
+++ b/src/projections/gstmerc.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)")
@@ -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..4c230a48 100644
--- a/src/projections/hammer.cpp
+++ b/src/projections/hammer.cpp
@@ -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..33bea55b 100644
--- a/src/projections/hatano.cpp
+++ b/src/projections/hatano.cpp
@@ -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..72dac71c 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)
@@ -37,8 +37,8 @@
#include "proj.h"
#include "projects.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..1e1cdb01 100644
--- a/src/projections/igh.cpp
+++ b/src/projections/igh.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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..db82e660 100644
--- a/src/projections/imw_p.cpp
+++ b/src/projections/imw_p.cpp
@@ -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..3ce4b623 100644
--- a/src/projections/isea.cpp
+++ b/src/projections/isea.cpp
@@ -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..6bd98f79 100644
--- a/src/projections/krovak.cpp
+++ b/src/projections/krovak.cpp
@@ -80,6 +80,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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..77120fa4 100644
--- a/src/projections/labrd.cpp
+++ b/src/projections/labrd.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(labrd, "Laborde") "\n\tCyl, Sph\n\tSpecial for Madagascar";
@@ -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..cfdd1326 100644
--- a/src/projections/laea.cpp
+++ b/src/projections/laea.cpp
@@ -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..c62b409b 100644
--- a/src/projections/lagrng.cpp
+++ b/src/projections/lagrng.cpp
@@ -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..4ece694d 100644
--- a/src/projections/larr.cpp
+++ b/src/projections/larr.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(larr, "Larrivee") "\n\tMisc Sph, no inv";
@@ -9,8 +10,8 @@ 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..d13a94e2 100644
--- a/src/projections/lask.cpp
+++ b/src/projections/lask.cpp
@@ -1,4 +1,6 @@
#define PJ_LIB__
+
+#include "proj.h"
#include "projects.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..4d22ea5b 100644
--- a/src/projections/latlong.cpp
+++ b/src/projections/latlong.cpp
@@ -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..1b00732f 100644
--- a/src/projections/lcc.cpp
+++ b/src/projections/lcc.cpp
@@ -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..e475dd6d 100644
--- a/src/projections/lcca.cpp
+++ b/src/projections/lcca.cpp
@@ -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..9c55cfce 100644
--- a/src/projections/loxim.cpp
+++ b/src/projections/loxim.cpp
@@ -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..95bf1813 100644
--- a/src/projections/lsat.cpp
+++ b/src/projections/lsat.cpp
@@ -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..6edc4103 100644
--- a/src/projections/mbt_fps.cpp
+++ b/src/projections/mbt_fps.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..f65b4ee2 100644
--- a/src/projections/mbtfpp.cpp
+++ b/src/projections/mbtfpp.cpp
@@ -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..0ead16d7 100644
--- a/src/projections/mbtfpq.cpp
+++ b/src/projections/mbtfpq.cpp
@@ -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..ba12fc8b 100644
--- a/src/projections/merc.cpp
+++ b/src/projections/merc.cpp
@@ -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..8171186a 100644
--- a/src/projections/mill.cpp
+++ b/src/projections/mill.cpp
@@ -2,12 +2,13 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..7ba74843 100644
--- a/src/projections/misrsom.cpp
+++ b/src/projections/misrsom.cpp
@@ -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..6603ec60 100644
--- a/src/projections/mod_ster.cpp
+++ b/src/projections/mod_ster.cpp
@@ -1,6 +1,7 @@
/* based upon Snyder and Linck, USGS-NMD */
#define PJ_LIB__
#include <errno.h>
+#include "proj.h"
#include "projects.h"
#include "proj_math.h"
@@ -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..ec7df64d 100644
--- a/src/projections/moll.cpp
+++ b/src/projections/moll.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(moll, "Mollweide") "\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..c1f1619c 100644
--- a/src/projections/natearth.cpp
+++ b/src/projections/natearth.cpp
@@ -16,6 +16,7 @@ Port to PROJ.4 by Bernhard Jenny, 6 June 2011
#include <math.h>
+#include "proj.h"
#include "projects.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..ca46fcfe 100644
--- a/src/projections/natearth2.cpp
+++ b/src/projections/natearth2.cpp
@@ -9,6 +9,7 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016
#include <math.h>
+#include "proj.h"
#include "projects.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..aac11ef2 100644
--- a/src/projections/nell.cpp
+++ b/src/projections/nell.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..db679dff 100644
--- a/src/projections/nell_h.cpp
+++ b/src/projections/nell_h.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..3805d33d 100644
--- a/src/projections/nicol.cpp
+++ b/src/projections/nicol.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(nicol, "Nicolosi Globular") "\n\tMisc Sph, no inv";
@@ -9,8 +10,8 @@ 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..0f646d00 100644
--- a/src/projections/nsper.cpp
+++ b/src/projections/nsper.cpp
@@ -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..a5eb07e2 100644
--- a/src/projections/nzmg.cpp
+++ b/src/projections/nzmg.cpp
@@ -29,6 +29,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..85f34f24 100644
--- a/src/projections/ob_tran.cpp
+++ b/src/projections/ob_tran.cpp
@@ -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..23d0e164 100644
--- a/src/projections/ocea.cpp
+++ b/src/projections/ocea.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area") "\n\tCyl, Sph"
@@ -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..78fa29be 100644
--- a/src/projections/oea.cpp
+++ b/src/projections/oea.cpp
@@ -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..255c38ae 100644
--- a/src/projections/omerc.cpp
+++ b/src/projections/omerc.cpp
@@ -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..ef29e62e 100644
--- a/src/projections/ortho.cpp
+++ b/src/projections/ortho.cpp
@@ -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..26abfba6 100644
--- a/src/projections/patterson.cpp
+++ b/src/projections/patterson.cpp
@@ -42,6 +42,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..6a7ff513 100644
--- a/src/projections/poly.cpp
+++ b/src/projections/poly.cpp
@@ -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..006cb813 100644
--- a/src/projections/putp2.cpp
+++ b/src/projections/putp2.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..ca356bd0 100644
--- a/src/projections/putp3.cpp
+++ b/src/projections/putp3.cpp
@@ -1,5 +1,7 @@
#define PJ_LIB__
#include <errno.h>
+
+#include "proj.h"
#include "projects.h"
namespace { // anonymous namespace
@@ -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..5ec465d2 100644
--- a/src/projections/putp4p.cpp
+++ b/src/projections/putp4p.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
namespace { // anonymous namespace
@@ -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..2baa3914 100644
--- a/src/projections/putp5.cpp
+++ b/src/projections/putp5.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
namespace { // anonymous namespace
@@ -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..134bbc8f 100644
--- a/src/projections/putp6.cpp
+++ b/src/projections/putp6.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
namespace { // anonymous namespace
@@ -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..ab287de8 100644
--- a/src/projections/qsc.cpp
+++ b/src/projections/qsc.cpp
@@ -43,6 +43,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
/* The six cube faces. */
@@ -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..d24cd7fa 100644
--- a/src/projections/robin.cpp
+++ b/src/projections/robin.cpp
@@ -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..2ac31855 100644
--- a/src/projections/rouss.cpp
+++ b/src/projections/rouss.cpp
@@ -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..e21e27ac 100644
--- a/src/projections/rpoly.cpp
+++ b/src/projections/rpoly.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
namespace { // anonymous namespace
@@ -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..418ebb5e 100644
--- a/src/projections/sch.cpp
+++ b/src/projections/sch.cpp
@@ -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..4e796136 100644
--- a/src/projections/sconics.cpp
+++ b/src/projections/sconics.cpp
@@ -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..6c554e7f 100644
--- a/src/projections/somerc.cpp
+++ b/src/projections/somerc.cpp
@@ -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..a26c27c2 100644
--- a/src/projections/stere.cpp
+++ b/src/projections/stere.cpp
@@ -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..60431a18 100644
--- a/src/projections/sterea.cpp
+++ b/src/projections/sterea.cpp
@@ -25,6 +25,7 @@
*/
#define PJ_LIB__
#include <errno.h>
+#include "proj.h"
#include "projects.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..bdb1fd72 100644
--- a/src/projections/sts.cpp
+++ b/src/projections/sts.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(kav5, "Kavraisky V") "\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..ebe21015 100644
--- a/src/projections/tcc.cpp
+++ b/src/projections/tcc.cpp
@@ -10,8 +10,8 @@ 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..6c7b44f5 100644
--- a/src/projections/tcea.cpp
+++ b/src/projections/tcea.cpp
@@ -2,21 +2,22 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..a7ff1b93 100644
--- a/src/projections/times.cpp
+++ b/src/projections/times.cpp
@@ -33,13 +33,14 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..29d88d6e 100644
--- a/src/projections/tmerc.cpp
+++ b/src/projections/tmerc.cpp
@@ -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..1889b484 100644
--- a/src/projections/tobmerc.cpp
+++ b/src/projections/tobmerc.cpp
@@ -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..e25f8ed3 100644
--- a/src/projections/tpeqd.cpp
+++ b/src/projections/tpeqd.cpp
@@ -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..576eac76 100644
--- a/src/projections/urm5.cpp
+++ b/src/projections/urm5.cpp
@@ -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..2aa6432c 100644
--- a/src/projections/urmfps.cpp
+++ b/src/projections/urmfps.cpp
@@ -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..91811b46 100644
--- a/src/projections/vandg.cpp
+++ b/src/projections/vandg.cpp
@@ -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..a1336029 100644
--- a/src/projections/vandg2.cpp
+++ b/src/projections/vandg2.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.h"
namespace { // anonymous namespace
@@ -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..15171b75 100644
--- a/src/projections/vandg4.cpp
+++ b/src/projections/vandg4.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.h"
PROJ_HEAD(vandg4, "van der Grinten IV") "\n\tMisc Sph, no inv";
@@ -9,8 +10,8 @@ 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..3b62593a 100644
--- a/src/projections/wag2.cpp
+++ b/src/projections/wag2.cpp
@@ -2,6 +2,7 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..c9d5470a 100644
--- a/src/projections/wag3.cpp
+++ b/src/projections/wag3.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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..eada904b 100644
--- a/src/projections/wag7.cpp
+++ b/src/projections/wag7.cpp
@@ -2,14 +2,15 @@
#include <math.h>
+#include "proj.h"
#include "projects.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..28eee9cf 100644
--- a/src/projections/wink1.cpp
+++ b/src/projections/wink1.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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..9e7ec411 100644
--- a/src/projections/wink2.cpp
+++ b/src/projections/wink2.cpp
@@ -3,6 +3,7 @@
#include <errno.h>
#include <math.h>
+#include "proj.h"
#include "projects.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;
diff --git a/src/projects.h b/src/projects.h
index 768b1c1d..81b27875 100644
--- a/src/projects.h
+++ b/src/projects.h
@@ -161,39 +161,7 @@ typedef long pj_int32;
#define DIR_CHAR '/'
#endif
-#define USE_PROJUV
-
-typedef struct { double u, v; } projUV;
typedef struct { double r, i; } COMPLEX;
-typedef struct { double u, v, w; } projUVW;
-
-/* If user explicitly includes proj.h, before projects.h, then avoid implicit type-punning */
-#ifndef PROJ_H
-#ifndef PJ_LIB__
-#define XY projUV
-#define LP projUV
-#define XYZ projUVW
-#define LPZ projUVW
-
-#else
-typedef struct { double x, y; } XY;
-typedef struct { double x, y, z; } XYZ;
-typedef struct { double lam, phi; } LP;
-typedef struct { double lam, phi, z; } LPZ;
-typedef struct { double u, v; } UV;
-typedef struct { double u, v, w; } UVW;
-#endif /* ndef PJ_LIB__ */
-
-#else
-typedef PJ_XY XY;
-typedef PJ_LP LP;
-typedef PJ_UV UV;
-typedef PJ_XYZ XYZ;
-typedef PJ_LPZ LPZ;
-typedef PJ_UVW UVW;
-
-#endif /* ndef PROJ_H */
-
/* Forward declarations and typedefs for stuff needed inside the PJ object */
struct PJconsts;
@@ -319,10 +287,10 @@ struct PJconsts {
**************************************************************************************/
- XY (*fwd)(LP, PJ *) = nullptr;
- LP (*inv)(XY, PJ *) = nullptr;
- XYZ (*fwd3d)(LPZ, PJ *) = nullptr;
- LPZ (*inv3d)(XYZ, PJ *) = nullptr;
+ PJ_XY (*fwd)(PJ_LP, PJ *) = nullptr;
+ PJ_LP (*inv)(PJ_XY, PJ *) = nullptr;
+ PJ_XYZ (*fwd3d)(PJ_LPZ, PJ *) = nullptr;
+ PJ_LPZ (*inv3d)(PJ_XYZ, PJ *) = nullptr;
PJ_OPERATOR fwd4d = nullptr;
PJ_OPERATOR inv4d = nullptr;
@@ -638,7 +606,7 @@ C_NAMESPACE_VAR struct PJ_DATUMS pj_datums[];
#ifdef PJ_LIB__
#define PROJ_HEAD(name, desc) static const char des_##name [] = desc
-#define OPERATION(name, NEED_ELLPS) \
+#define OPERATION(name, NEED_ELPJ_LPS) \
\
pj_projection_specific_setup_##name (PJ *P); \
C_NAMESPACE PJ *pj_##name (PJ *P); \
@@ -652,7 +620,7 @@ C_NAMESPACE PJ *pj_##name (PJ *P) { \
if (nullptr==P) \
return nullptr; \
P->descr = des_##name; \
- P->need_ellps = NEED_ELLPS; \
+ P->need_ellps = NEED_ELPJ_LPS; \
P->left = PJ_IO_UNITS_ANGULAR; \
P->right = PJ_IO_UNITS_CLASSIC; \
return P; \
@@ -676,8 +644,8 @@ typedef struct { pj_int32 lam, phi; } ILP;
struct CTABLE {
char id[MAX_TAB_ID]; /* ascii info */
- LP ll; /* lower left corner coordinates */
- LP del; /* size of cells */
+ PJ_LP ll; /* lower left corner coordinates */
+ PJ_LP del; /* size of cells */
ILP lim; /* limits of conversion matrix */
FLP *cvs; /* conversion matrix */
};
@@ -759,8 +727,8 @@ double pj_authlat(double, double *);
COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int);
COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *);
-int pj_deriv(LP, double, const PJ *, struct DERIVS *);
-int pj_factors(LP, const PJ *, double, struct FACTORS *);
+int pj_deriv(PJ_LP, double, const PJ *, struct DERIVS *);
+int pj_factors(PJ_LP, const PJ *, double, struct FACTORS *);
struct PW_COEF { /* row coefficient structure */
int m; /* number of c coefficients (=0 for none) */
@@ -769,26 +737,26 @@ struct PW_COEF { /* row coefficient structure */
/* Approximation structures and procedures */
typedef struct { /* Chebyshev or Power series structure */
- projUV a, b; /* power series range for evaluation */
+ PJ_UV a, b; /* power series range for evaluation */
/* or Chebyshev argument shift/scaling */
struct PW_COEF *cu, *cv;
int mu, mv; /* maximum cu and cv index (+1 for count) */
int power; /* != 0 if power series, else Chebyshev */
} Tseries;
-Tseries PROJ_DLL *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int);
-projUV bpseval(projUV, Tseries *);
-projUV bcheval(projUV, Tseries *);
-projUV biveval(projUV, Tseries *);
+Tseries PROJ_DLL *mk_cheby(PJ_UV, PJ_UV, double, PJ_UV *, PJ_UV (*)(PJ_UV), int, int, int);
+PJ_UV bpseval(PJ_UV, Tseries *);
+PJ_UV bcheval(PJ_UV, Tseries *);
+PJ_UV biveval(PJ_UV, Tseries *);
void *vector1(int, int);
void **vector2(int, int, int);
void freev2(void **v, int nrows);
-int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV));
-int bch2bps(projUV, projUV, projUV **, int, int);
+int bchgen(PJ_UV, PJ_UV, int, int, PJ_UV **, PJ_UV(*)(PJ_UV));
+int bch2bps(PJ_UV, PJ_UV, PJ_UV **, int, int);
/* nadcon related protos */
-LP nad_intr(LP, struct CTABLE *);
-LP nad_cvt(LP, int, struct CTABLE *);
+PJ_LP nad_intr(PJ_LP, struct CTABLE *);
+PJ_LP nad_cvt(PJ_LP, int, struct CTABLE *);
struct CTABLE *nad_init(projCtx ctx, char *);
struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid );
int nad_ctable_load( projCtx ctx, struct CTABLE *, PAFile fid );
@@ -831,7 +799,7 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx,
PJ_GridCatalog *catalog, int after,
- LP location, double date,
+ PJ_LP location, double date,
PJ_Region *optional_region,
double *grid_date );
@@ -841,8 +809,8 @@ void *proj_mdist_ini(double);
double proj_mdist(double, double, double, const void *);
double proj_inv_mdist(projCtx ctx, double, const void *);
void *pj_gauss_ini(double, double, double *,double *);
-LP pj_gauss(projCtx, LP, const void *);
-LP pj_inv_gauss(projCtx, LP, const void *);
+PJ_LP pj_gauss(projCtx, PJ_LP, const void *);
+PJ_LP pj_inv_gauss(projCtx, PJ_LP, const void *);
struct PJ_DATUMS PROJ_DLL *pj_get_datums_ref( void );
diff --git a/src/qsfn.cpp b/src/qsfn.cpp
index c18a7b95..c8592d3d 100644
--- a/src/qsfn.cpp
+++ b/src/qsfn.cpp
@@ -1,5 +1,6 @@
/* determine small q */
#include <math.h>
+#include "proj.h"
#include "projects.h"
# define EPSILON 1.0e-7
diff --git a/src/rtodms.cpp b/src/rtodms.cpp
index 674cebdf..d7686931 100644
--- a/src/rtodms.cpp
+++ b/src/rtodms.cpp
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
/*
diff --git a/src/strtod.cpp b/src/strtod.cpp
index 5a360c2e..ccf26321 100644
--- a/src/strtod.cpp
+++ b/src/strtod.cpp
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
/* Windows nmake build doesn't have a proj_config.h, but HAVE_LOCALECONV */
diff --git a/src/transform.cpp b/src/transform.cpp
index 433fc017..2c8dc467 100644
--- a/src/transform.cpp
+++ b/src/transform.cpp
@@ -193,8 +193,8 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
for( i = 0; i < n; i++ )
{
- XYZ projected_loc;
- LPZ geodetic_loc;
+ PJ_XYZ projected_loc;
+ PJ_LPZ geodetic_loc;
geodetic_loc.lam = x[dist*i];
geodetic_loc.phi = y[dist*i];
@@ -232,8 +232,8 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
for( i = 0; i <n; i++ )
{
- XY projected_loc;
- LP geodetic_loc;
+ PJ_XY projected_loc;
+ PJ_LP geodetic_loc;
geodetic_loc.lam = x[dist*i];
geodetic_loc.phi = y[dist*i];
@@ -303,8 +303,8 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
for (i=0; i < n; i++)
{
- XYZ projected_loc;
- LPZ geodetic_loc;
+ PJ_XYZ projected_loc;
+ PJ_LPZ geodetic_loc;
projected_loc.x = x[dist*i];
projected_loc.y = y[dist*i];
@@ -343,8 +343,8 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
/* Fallback to the original PROJ.4 API 2d inversion - inv */
for( i = 0; i < n; i++ ) {
- XY projected_loc;
- LP geodetic_loc;
+ PJ_XY projected_loc;
+ PJ_LP geodetic_loc;
projected_loc.x = x[dist*i];
projected_loc.y = y[dist*i];
diff --git a/src/transformations/affine.cpp b/src/transformations/affine.cpp
index e2b668d3..002bb2dd 100644
--- a/src/transformations/affine.cpp
+++ b/src/transformations/affine.cpp
@@ -70,14 +70,14 @@ static PJ_COORD forward_4d(PJ_COORD obs, PJ *P) {
return newObs;
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lpz = lpz;
return forward_4d(point, P).xyz;
}
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lp = lp;
return forward_4d(point, P).xy;
@@ -98,13 +98,13 @@ static PJ_COORD reverse_4d(PJ_COORD obs, PJ *P) {
return newObs;
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xyz = xyz;
return reverse_4d(point, P).lpz;
}
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xy = xy;
return reverse_4d(point, P).lp;
diff --git a/src/transformations/deformation.cpp b/src/transformations/deformation.cpp
index 0197cf5c..7efe8a8c 100644
--- a/src/transformations/deformation.cpp
+++ b/src/transformations/deformation.cpp
@@ -19,7 +19,7 @@ returns cartesian coordinates as well.
Corrections in the gridded model are in east, north, up (ENU) space.
Hence the input coordinates needs to be converted to ENU-space when
searching for corrections in the grid. The corrections are then converted
-to cartesian XYZ-space and applied to the input coordinates (also in
+to cartesian PJ_XYZ-space and applied to the input coordinates (also in
cartesian space).
A full deformation model is described by two grids, one for the horizontal
@@ -72,12 +72,12 @@ struct pj_opaque {
} // anonymous namespace
/********************************************************************************/
-static XYZ get_grid_shift(PJ* P, XYZ cartesian) {
+static PJ_XYZ get_grid_shift(PJ* P, PJ_XYZ cartesian) {
/********************************************************************************
Read correction values from grid. The cartesian input coordinates are
converted to geodetic coordinates in order look up the correction values
in the grid. Once the grid corrections are read we need to convert them
- from ENU-space to cartesian XYZ-space. ENU -> XYZ formula described in:
+ from ENU-space to cartesian PJ_XYZ-space. ENU -> PJ_XYZ formula described in:
Nørbech, T., et al, 2003(?), "Transformation from a Common Nordic Reference
Frame to ETRS89 in Denmark, Finland, Norway, and Sweden – status report"
@@ -109,7 +109,7 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) {
sl = sin(geodetic.lp.lam);
cl = cos(geodetic.lp.lam);
- /* ENU -> XYZ */
+ /* ENU -> PJ_XYZ */
temp.xyz.x = -sp*cl*shift.enu.n - sl*shift.enu.e + cp*cl*shift.enu.u;
temp.xyz.y = -sp*sl*shift.enu.n + cl*shift.enu.e + cp*sl*shift.enu.u;
temp.xyz.z = cp*shift.enu.n + sp*shift.enu.u;
@@ -122,11 +122,11 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) {
}
/********************************************************************************/
-static XYZ reverse_shift(PJ *P, XYZ input, double dt) {
+static PJ_XYZ reverse_shift(PJ *P, PJ_XYZ input, double dt) {
/********************************************************************************
Iteratively determine the reverse grid shift correction values.
*********************************************************************************/
- XYZ out, delta, dif;
+ PJ_XYZ out, delta, dif;
double z0;
int i = MAX_ITERATIONS;
@@ -163,10 +163,10 @@ static XYZ reverse_shift(PJ *P, XYZ input, double dt) {
return out;
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
PJ_COORD out, in;
- XYZ shift;
+ PJ_XYZ shift;
double dt = 0.0;
in.lpz = lpz;
out = in;
@@ -192,7 +192,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
static PJ_COORD forward_4d(PJ_COORD in, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
double dt;
- XYZ shift;
+ PJ_XYZ shift;
PJ_COORD out = in;
if (Q->t_obs != HUGE_VAL) {
@@ -212,7 +212,7 @@ static PJ_COORD forward_4d(PJ_COORD in, PJ *P) {
}
-static LPZ reverse_3d(XYZ in, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ in, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
PJ_COORD out;
double dt = 0.0;
diff --git a/src/transformations/helmert.cpp b/src/transformations/helmert.cpp
index 4a3abf4e..55112aaa 100644
--- a/src/transformations/helmert.cpp
+++ b/src/transformations/helmert.cpp
@@ -59,8 +59,8 @@ Last update: 2018-10-26
PROJ_HEAD(helmert, "3(6)-, 4(8)- and 7(14)-parameter Helmert shift");
PROJ_HEAD(molobadekas, "Molodensky-Badekas transformation");
-static XYZ helmert_forward_3d (LPZ lpz, PJ *P);
-static LPZ helmert_reverse_3d (XYZ xyz, PJ *P);
+static PJ_XYZ helmert_forward_3d (PJ_LPZ lpz, PJ *P);
+static PJ_LPZ helmert_reverse_3d (PJ_XYZ xyz, PJ *P);
@@ -70,10 +70,10 @@ struct pj_opaque_helmert {
/************************************************************************
Projection specific elements for the "helmert" PJ object
************************************************************************/
- XYZ xyz;
- XYZ xyz_0;
- XYZ dxyz;
- XYZ refp;
+ PJ_XYZ xyz;
+ PJ_XYZ xyz_0;
+ PJ_XYZ dxyz;
+ PJ_XYZ refp;
PJ_OPK opk;
PJ_OPK opk_0;
PJ_OPK dopk;
@@ -322,7 +322,7 @@ static void build_rot_matrix(PJ *P) {
/***********************************************************************/
-static XY helmert_forward (LP lp, PJ *P) {
+static PJ_XY helmert_forward (PJ_LP lp, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -342,7 +342,7 @@ static XY helmert_forward (LP lp, PJ *P) {
/***********************************************************************/
-static LP helmert_reverse (XY xy, PJ *P) {
+static PJ_LP helmert_reverse (PJ_XY xy, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -362,7 +362,7 @@ static LP helmert_reverse (XY xy, PJ *P) {
/***********************************************************************/
-static XYZ helmert_forward_3d (LPZ lpz, PJ *P) {
+static PJ_XYZ helmert_forward_3d (PJ_LPZ lpz, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -402,7 +402,7 @@ static XYZ helmert_forward_3d (LPZ lpz, PJ *P) {
/***********************************************************************/
-static LPZ helmert_reverse_3d (XYZ xyz, PJ *P) {
+static PJ_LPZ helmert_reverse_3d (PJ_XYZ xyz, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
diff --git a/src/transformations/hgridshift.cpp b/src/transformations/hgridshift.cpp
index f0e57251..c8dfea15 100644
--- a/src/transformations/hgridshift.cpp
+++ b/src/transformations/hgridshift.cpp
@@ -17,7 +17,7 @@ struct pj_opaque_hgridshift {
};
} // anonymous namespace
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lpz = lpz;
@@ -31,7 +31,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xyz = xyz;
diff --git a/src/transformations/horner.cpp b/src/transformations/horner.cpp
index 73977de6..271d1187 100644
--- a/src/transformations/horner.cpp
+++ b/src/transformations/horner.cpp
@@ -83,6 +83,7 @@
#include <stdio.h>
#include <string.h>
+#include "proj.h"
#include "proj_internal.h"
#include "projects.h"
@@ -109,13 +110,13 @@ struct horner {
double *fwd_c; /* coefficients for the complex forward transformations */
double *inv_c; /* coefficients for the complex inverse transformations */
- UV *fwd_origin; /* False longitude/latitude */
- UV *inv_origin; /* False easting/northing */
+ PJ_UV *fwd_origin; /* False longitude/latitude */
+ PJ_UV *inv_origin; /* False easting/northing */
};
} // anonymous namespace
typedef struct horner HORNER;
-static UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, UV position);
+static PJ_UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position);
static HORNER *horner_alloc (size_t order, int complex_polynomia);
static void horner_free (HORNER *h);
@@ -166,8 +167,8 @@ static HORNER *horner_alloc (size_t order, int complex_polynomia) {
polynomia_ok = 1;
}
- h->fwd_origin = static_cast<UV*>(horner_calloc (1, sizeof(UV)));
- h->inv_origin = static_cast<UV*>(horner_calloc (1, sizeof(UV)));
+ h->fwd_origin = static_cast<PJ_UV*>(horner_calloc (1, sizeof(PJ_UV)));
+ h->inv_origin = static_cast<PJ_UV*>(horner_calloc (1, sizeof(PJ_UV)));
if (polynomia_ok && h->fwd_origin && h->inv_origin)
return h;
@@ -181,7 +182,7 @@ static HORNER *horner_alloc (size_t order, int complex_polynomia) {
/**********************************************************************/
-static UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, UV position) {
+static PJ_UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) {
/***********************************************************************
A reimplementation of the classic Engsager/Poder 2D Horner polynomial
@@ -223,7 +224,7 @@ summing the tiny high order elements first.
double *tcx, *tcy; /* Coefficient pointers */
double range; /* Equivalent to the gen_pol's FLOATLIMIT constant */
double n, e;
- UV uv_error;
+ PJ_UV uv_error;
uv_error.u = uv_error.v = HUGE_VAL;
if (nullptr==transformation)
@@ -310,7 +311,7 @@ static PJ_COORD horner_reverse_4d (PJ_COORD point, PJ *P) {
/**********************************************************************/
-static UV complex_horner (const HORNER *transformation, PJ_DIRECTION direction, UV position) {
+static PJ_UV complex_horner (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) {
/***********************************************************************
A reimplementation of a classic Engsager/Poder Horner complex
@@ -323,7 +324,7 @@ polynomial evaluation engine.
double *c, *cb; /* Coefficient pointers */
double range; /* Equivalent to the gen_pol's FLOATLIMIT constant */
double n, e, w, N, E;
- UV uv_error;
+ PJ_UV uv_error;
uv_error.u = uv_error.v = HUGE_VAL;
if (nullptr==transformation)
diff --git a/src/transformations/molodensky.cpp b/src/transformations/molodensky.cpp
index 91743fda..843da5c9 100644
--- a/src/transformations/molodensky.cpp
+++ b/src/transformations/molodensky.cpp
@@ -53,8 +53,8 @@
PROJ_HEAD(molodensky, "Molodensky transform");
-static XYZ forward_3d(LPZ lpz, PJ *P);
-static LPZ reverse_3d(XYZ xyz, PJ *P);
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P);
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P);
namespace { // anonymous namespace
struct pj_opaque_molodensky {
@@ -123,7 +123,7 @@ static double RM (double a, double es, double phi) {
}
-static LPZ calc_standard_params(LPZ lpz, PJ *P) {
+static PJ_LPZ calc_standard_params(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
double dphi, dlam, dh;
@@ -162,7 +162,7 @@ static LPZ calc_standard_params(LPZ lpz, PJ *P) {
}
-static LPZ calc_abridged_params(LPZ lpz, PJ *P) {
+static PJ_LPZ calc_abridged_params(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
double dphi, dlam, dh;
@@ -197,7 +197,7 @@ static LPZ calc_abridged_params(LPZ lpz, PJ *P) {
}
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lp = lp;
@@ -207,7 +207,7 @@ static XY forward_2d(LP lp, PJ *P) {
}
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xy = xy;
@@ -218,7 +218,7 @@ static LP reverse_2d(XY xy, PJ *P) {
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -246,10 +246,10 @@ static PJ_COORD forward_4d(PJ_COORD obs, PJ *P) {
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
- LPZ lpz;
+ PJ_LPZ lpz;
/* calculate parameters depending on the mode we are in */
point.xyz = xyz;
diff --git a/src/transformations/vgridshift.cpp b/src/transformations/vgridshift.cpp
index b3da906d..fe2bc3e5 100644
--- a/src/transformations/vgridshift.cpp
+++ b/src/transformations/vgridshift.cpp
@@ -18,7 +18,7 @@ struct pj_opaque_vgridshift {
};
} // anonymous namespace
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_vgridshift *Q = (struct pj_opaque_vgridshift *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
point.lpz = lpz;
@@ -33,7 +33,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
struct pj_opaque_vgridshift *Q = (struct pj_opaque_vgridshift *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
point.xyz = xyz;
diff --git a/src/tsfn.cpp b/src/tsfn.cpp
index ea3b896d..fb299dc9 100644
--- a/src/tsfn.cpp
+++ b/src/tsfn.cpp
@@ -1,5 +1,6 @@
/* determine small t */
#include <math.h>
+#include "proj.h"
#include "projects.h"
double pj_tsfn(double phi, double sinphi, double e) {
diff --git a/src/utils.cpp b/src/utils.cpp
index 8587dc30..9a320fa4 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <string.h>
+#include "proj.h"
#include "projects.h"
/************************************************************************/
diff --git a/src/vector1.cpp b/src/vector1.cpp
index 869dd76a..31a425a8 100644
--- a/src/vector1.cpp
+++ b/src/vector1.cpp
@@ -1,5 +1,6 @@
/* make storage for one and two dimensional matricies */
#include <stdlib.h>
+#include "proj.h"
#include "projects.h"
void * /* one dimension array */
vector1(int nvals, int size) { return((void *)pj_malloc(size * nvals)); }
diff --git a/src/zpoly1.cpp b/src/zpoly1.cpp
index bacb62ce..5aded697 100644
--- a/src/zpoly1.cpp
+++ b/src/zpoly1.cpp
@@ -1,4 +1,5 @@
/* evaluate complex polynomial */
+#include "proj.h"
#include "projects.h"
/* note: coefficients are always from C_1 to C_n
** i.e. C_0 == (0., 0)