diff options
202 files changed, 980 insertions, 1052 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp index 43ffe72c..ce9d7bd9 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -39,7 +39,7 @@ #include "proj.h" #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" #include "geodesic.h" #include "proj/common.hpp" diff --git a/src/Makefile.am b/src/Makefile.am index e8b9977c..3b23a044 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,7 +48,7 @@ libproj_la_LDFLAGS = -no-undefined -version-info 14:1:1 libproj_la_LIBADD = @SQLITE3_LDFLAGS@ libproj_la_SOURCES = \ - pj_list.h proj_internal.h proj_math.h projects.h \ + pj_list.h proj_internal.h proj_math.h \ \ iso19111/static.cpp \ iso19111/util.cpp \ diff --git a/src/aasincos.cpp b/src/aasincos.cpp index d2851716..398a8cfc 100644 --- a/src/aasincos.cpp +++ b/src/aasincos.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #define ONE_TOL 1.00000000000001 #define ATOL 1e-50 diff --git a/src/adjlon.cpp b/src/adjlon.cpp index 52448c2e..112a9152 100644 --- a/src/adjlon.cpp +++ b/src/adjlon.cpp @@ -2,7 +2,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" double adjlon (double lon) { /* Let lon slightly overshoot, to avoid spurious sign switching at the date line */ diff --git a/src/apply_gridshift.cpp b/src/apply_gridshift.cpp index 4fd9b077..c7070432 100644 --- a/src/apply_gridshift.cpp +++ b/src/apply_gridshift.cpp @@ -36,7 +36,7 @@ #include "proj_internal.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /************************************************************************/ /* pj_apply_gridshift() */ diff --git a/src/apply_vgridshift.cpp b/src/apply_vgridshift.cpp index 5384f368..61e0c528 100644 --- a/src/apply_vgridshift.cpp +++ b/src/apply_vgridshift.cpp @@ -33,7 +33,7 @@ #include "proj_math.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" static int is_nodata(float value) { diff --git a/src/apps/cct.cpp b/src/apps/cct.cpp index 046257da..4deefba6 100644 --- a/src/apps/cct.cpp +++ b/src/apps/cct.cpp @@ -81,7 +81,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-25/2017-10-26 #include "proj.h" #include "proj_internal.h" #include "proj_strtod.h" -#include "projects.h" +#include "proj_internal.h" #include "optargpm.h" diff --git a/src/apps/cs2cs.cpp b/src/apps/cs2cs.cpp index 9000454a..e7f43c76 100644 --- a/src/apps/cs2cs.cpp +++ b/src/apps/cs2cs.cpp @@ -43,7 +43,7 @@ // PROJ include order is sensitive // clang-format off #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "emess.h" // clang-format on diff --git a/src/apps/gen_cheb.cpp b/src/apps/gen_cheb.cpp index 167ee79d..23285314 100644 --- a/src/apps/gen_cheb.cpp +++ b/src/apps/gen_cheb.cpp @@ -1,7 +1,7 @@ /* generates 'T' option output */ #define PJ_LIB__ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include <stdio.h> #include <string.h> #include <errno.h> diff --git a/src/apps/geod.cpp b/src/apps/geod.cpp index 7b6367c6..7225856e 100644 --- a/src/apps/geod.cpp +++ b/src/apps/geod.cpp @@ -1,7 +1,7 @@ /* <<<< Geodesic filter program >>>> */ #include "proj.h" -# include "projects.h" +# include "proj_internal.h" # include "geod_interface.h" # include "emess.h" # include <ctype.h> diff --git a/src/apps/geod_interface.cpp b/src/apps/geod_interface.cpp index 1a085b38..a21a89e6 100644 --- a/src/apps/geod_interface.cpp +++ b/src/apps/geod_interface.cpp @@ -1,5 +1,5 @@ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "geod_interface.h" void geod_ini(void) { diff --git a/src/apps/geod_set.cpp b/src/apps/geod_set.cpp index b9e9c42f..cd6b5018 100644 --- a/src/apps/geod_set.cpp +++ b/src/apps/geod_set.cpp @@ -5,7 +5,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "geod_interface.h" #include "emess.h" diff --git a/src/apps/gie.cpp b/src/apps/gie.cpp index 3e4770a2..e912a076 100644 --- a/src/apps/gie.cpp +++ b/src/apps/gie.cpp @@ -117,7 +117,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2017-10-01/2017-10-08 #include "proj_internal.h" #include "proj_math.h" #include "proj_strtod.h" -#include "projects.h" +#include "proj_internal.h" #include "optargpm.h" diff --git a/src/apps/nad2bin.cpp b/src/apps/nad2bin.cpp index 62a7b320..a684b087 100644 --- a/src/apps/nad2bin.cpp +++ b/src/apps/nad2bin.cpp @@ -4,7 +4,7 @@ #define PJ_LIB__ #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" #define U_SEC_TO_RAD 4.848136811095359935899141023e-12 /************************************************************************/ diff --git a/src/apps/p_series.cpp b/src/apps/p_series.cpp index 3815824b..2f668ce0 100644 --- a/src/apps/p_series.cpp +++ b/src/apps/p_series.cpp @@ -1,6 +1,6 @@ /* print row coefficients of Tseries structure */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include <stdio.h> #include <string.h> #define NF 20 /* length of final format string */ diff --git a/src/apps/proj.cpp b/src/apps/proj.cpp index 9958a777..c8cd20a1 100644 --- a/src/apps/proj.cpp +++ b/src/apps/proj.cpp @@ -1,6 +1,6 @@ /* <<<< Cartographic projection filter program >>>> */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 589ca832..4fcd3e5e 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -36,7 +36,7 @@ #include <utility> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include <proj/common.hpp> #include <proj/coordinateoperation.hpp> diff --git a/src/auth.cpp b/src/auth.cpp index 3da63c60..a8ee262a 100644 --- a/src/auth.cpp +++ b/src/auth.cpp @@ -4,7 +4,7 @@ #include <stddef.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" # define P00 .33333333333333333333 /* 1 / 3 */ # define P01 .17222222222222222222 /* 31 / 180 */ diff --git a/src/bch2bps.cpp b/src/bch2bps.cpp index 1812ee2b..9346457c 100644 --- a/src/bch2bps.cpp +++ b/src/bch2bps.cpp @@ -1,7 +1,7 @@ /* convert bivariate w Chebyshev series to w Power series */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* basic support procedures */ static void /* clear vector to zero */ clear(PJ_UV *p, int n) { static const PJ_UV c = {0., 0.}; while (n--) *p++ = c; } diff --git a/src/bchgen.cpp b/src/bchgen.cpp index 324ac8f6..9677b6f2 100644 --- a/src/bchgen.cpp +++ b/src/bchgen.cpp @@ -1,6 +1,6 @@ /* generate double bivariate Chebychev polynomial */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" int bchgen(PJ_UV a, PJ_UV b, int nu, int nv, PJ_UV **f, PJ_UV(*func)(PJ_UV)) { int i, j, k; diff --git a/src/biveval.cpp b/src/biveval.cpp index 219534c3..9ead2fb7 100644 --- a/src/biveval.cpp +++ b/src/biveval.cpp @@ -1,6 +1,6 @@ /* procedures for evaluating Tseries */ #include "proj.h" -# include "projects.h" +#include "proj_internal.h" # define NEAR_ONE 1.00001 static double ceval(struct PW_COEF *C, int n, PJ_UV w, PJ_UV w2) { double d=0, dd=0, vd, vdd, tmp, *c; diff --git a/src/conversions/axisswap.cpp b/src/conversions/axisswap.cpp index f9dd4fa5..18d13f8c 100644 --- a/src/conversions/axisswap.cpp +++ b/src/conversions/axisswap.cpp @@ -59,7 +59,7 @@ operation: #include "proj.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(axisswap, "Axis ordering"); diff --git a/src/conversions/cart.cpp b/src/conversions/cart.cpp index bcfbb5e6..f8ec256b 100644 --- a/src/conversions/cart.cpp +++ b/src/conversions/cart.cpp @@ -43,7 +43,7 @@ #define PJ_LIB__ #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(cart, "Geodetic/cartesian conversions"); diff --git a/src/conversions/geoc.cpp b/src/conversions/geoc.cpp index 0455fada..66ca6199 100644 --- a/src/conversions/geoc.cpp +++ b/src/conversions/geoc.cpp @@ -32,7 +32,7 @@ #include "proj.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(geoc, "Geocentric Latitude"); diff --git a/src/conversions/geocent.cpp b/src/conversions/geocent.cpp index d5f3e075..c8d2d486 100644 --- a/src/conversions/geocent.cpp +++ b/src/conversions/geocent.cpp @@ -30,7 +30,7 @@ #define PJ_LIB__ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(geocent, "Geocentric") "\n\t"; diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp index 10c56344..cbd81a7d 100644 --- a/src/conversions/unitconvert.cpp +++ b/src/conversions/unitconvert.cpp @@ -72,7 +72,7 @@ Last update: 2017-05-16 #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(unitconvert, "Unit conversion"); diff --git a/src/ctx.cpp b/src/ctx.cpp index 1742ee87..195f3b7f 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -31,7 +31,7 @@ #include "proj_experimental.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" static projCtx_t default_context; static volatile int default_context_initialized = 0; diff --git a/src/datum_set.cpp b/src/datum_set.cpp index 7fca783f..c1cb4cb9 100644 --- a/src/datum_set.cpp +++ b/src/datum_set.cpp @@ -29,7 +29,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* SEC_TO_RAD = Pi/180/3600 */ #define SEC_TO_RAD 4.84813681109535993589914102357e-6 diff --git a/src/datums.cpp b/src/datums.cpp index acbe12f7..5b57a713 100644 --- a/src/datums.cpp +++ b/src/datums.cpp @@ -30,7 +30,7 @@ #include "proj.h" #define PJ_DATUMS__ -#include "projects.h" +#include "proj_internal.h" /* * The ellipse code must match one from pj_ellps.c. The datum id should diff --git a/src/deriv.cpp b/src/deriv.cpp index 3839809e..bc7fa19e 100644 --- a/src/deriv.cpp +++ b/src/deriv.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" int pj_deriv(PJ_LP lp, double h, const PJ *P, struct DERIVS *der) { PJ_XY t; diff --git a/src/dmstor.cpp b/src/dmstor.cpp index bffebc9c..3ba66030 100644 --- a/src/dmstor.cpp +++ b/src/dmstor.cpp @@ -6,7 +6,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static double proj_strtod(char *nptr, char **endptr); diff --git a/src/ell_set.cpp b/src/ell_set.cpp index ee819917..65049a90 100644 --- a/src/ell_set.cpp +++ b/src/ell_set.cpp @@ -6,7 +6,7 @@ #include "proj.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" /* Prototypes of the pj_ellipsoid helper functions */ diff --git a/src/ellps.cpp b/src/ellps.cpp index f548d30d..7a42768b 100644 --- a/src/ellps.cpp +++ b/src/ellps.cpp @@ -3,7 +3,7 @@ #include <stddef.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static const struct PJ_ELLPS pj_ellps[] = { diff --git a/src/errno.cpp b/src/errno.cpp index f948a945..4f3119b3 100644 --- a/src/errno.cpp +++ b/src/errno.cpp @@ -1,7 +1,7 @@ /* For full ANSI compliance of global variable */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" int pj_errno = 0; diff --git a/src/factors.cpp b/src/factors.cpp index 76b0d4e6..f50c8e21 100644 --- a/src/factors.cpp +++ b/src/factors.cpp @@ -3,7 +3,7 @@ #include "proj.h" #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" #include <errno.h> diff --git a/src/fileapi.cpp b/src/fileapi.cpp index c9e986e5..70c7b5de 100644 --- a/src/fileapi.cpp +++ b/src/fileapi.cpp @@ -33,7 +33,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static PAFile stdio_fopen(projCtx ctx, const char *filename, const char *access); diff --git a/src/fwd.cpp b/src/fwd.cpp index 2824a039..02f31f87 100644 --- a/src/fwd.cpp +++ b/src/fwd.cpp @@ -33,7 +33,7 @@ #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" #define INPUT_UNITS P->left #define OUTPUT_UNITS P->right diff --git a/src/gauss.cpp b/src/gauss.cpp index d7354bdc..b7a27191 100644 --- a/src/gauss.cpp +++ b/src/gauss.cpp @@ -29,7 +29,7 @@ #include <stdlib.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #define MAX_ITER 20 diff --git a/src/gc_reader.cpp b/src/gc_reader.cpp index 094aa44c..def52a11 100644 --- a/src/gc_reader.cpp +++ b/src/gc_reader.cpp @@ -33,7 +33,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static int gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry); diff --git a/src/gridcatalog.cpp b/src/gridcatalog.cpp index 18f93b4e..ca5750ab 100644 --- a/src/gridcatalog.cpp +++ b/src/gridcatalog.cpp @@ -33,7 +33,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static PJ_GridCatalog *grid_catalog_list = nullptr; diff --git a/src/gridinfo.cpp b/src/gridinfo.cpp index 041de935..1a0bc16a 100644 --- a/src/gridinfo.cpp +++ b/src/gridinfo.cpp @@ -36,7 +36,7 @@ #include <string.h> #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" /************************************************************************/ /* swap_words() */ diff --git a/src/gridlist.cpp b/src/gridlist.cpp index 41f4e2c5..c540b134 100644 --- a/src/gridlist.cpp +++ b/src/gridlist.cpp @@ -33,7 +33,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static PJ_GRIDINFO *grid_list = nullptr; #define PJ_MAX_PATH_LENGTH 1024 diff --git a/src/init.cpp b/src/init.cpp index bc5f6dcb..85c59d58 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -40,7 +40,7 @@ #include "proj.h" #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" /**************************************************************************************/ diff --git a/src/initcache.cpp b/src/initcache.cpp index 4d1d8695..6120a406 100644 --- a/src/initcache.cpp +++ b/src/initcache.cpp @@ -28,7 +28,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static int cache_count = 0; static int cache_alloc = 0; diff --git a/src/internal.cpp b/src/internal.cpp index 41744d16..f774cad6 100644 --- a/src/internal.cpp +++ b/src/internal.cpp @@ -39,7 +39,7 @@ #include "geodesic.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" enum pj_io_units pj_left (PJ *P) { diff --git a/src/inv.cpp b/src/inv.cpp index 8ce5dfcd..83c5498c 100644 --- a/src/inv.cpp +++ b/src/inv.cpp @@ -32,7 +32,7 @@ #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" #define INPUT_UNITS P->right #define OUTPUT_UNITS P->left diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp index 0fe0c247..20629e8b 100644 --- a/src/iso19111/c_api.cpp +++ b/src/iso19111/c_api.cpp @@ -50,10 +50,9 @@ // PROJ include order is sensitive // clang-format off -#include "proj_internal.h" #include "proj.h" +#include "proj_internal.h" #include "proj_experimental.h" -#include "projects.h" // clang-format on #include "proj_constants.h" diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 6b6651da..93314b85 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -44,7 +44,7 @@ // PROJ include order is sensitive // clang-format off #include "proj.h" -#include "projects.h" // M_PI +#include "proj_internal.h" // M_PI // clang-format on #include <algorithm> diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp index 16e86296..320be14b 100644 --- a/src/iso19111/datum.cpp +++ b/src/iso19111/datum.cpp @@ -42,7 +42,7 @@ // PROJ include order is sensitive // clang-format off #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_api.h" // clang-format on diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp index 47d31db9..dcc32f32 100644 --- a/src/iso19111/factory.cpp +++ b/src/iso19111/factory.cpp @@ -59,7 +59,7 @@ // PROJ include order is sensitive // clang-format off #include "proj.h" -#include "projects.h" +#include "proj_internal.h" // clang-format on #include <sqlite3.h> diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index effb3968..15a069c6 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -66,7 +66,7 @@ // PROJ include order is sensitive // clang-format off #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_api.h" // clang-format on diff --git a/src/jniproj.cpp b/src/jniproj.cpp index e6f83270..59b5b2a0 100644 --- a/src/jniproj.cpp +++ b/src/jniproj.cpp @@ -48,7 +48,7 @@ #include <math.h> #include <string.h> -#include "projects.h" +#include "proj_internal.h" #include "org_proj4_PJ.h" #include <jni.h> diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake index 767106e6..b595d87e 100644 --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -200,7 +200,7 @@ SET(SRC_LIBPROJ_ISO19111 ) SET(SRC_LIBPROJ_CORE - pj_list.h proj_internal.h proj_math.h projects.h + pj_list.h proj_internal.h proj_math.h aasincos.cpp adjlon.cpp bch2bps.cpp bchgen.cpp biveval.cpp dmstor.cpp mk_cheby.cpp auth.cpp deriv.cpp ell_set.cpp ellps.cpp errno.cpp diff --git a/src/list.cpp b/src/list.cpp index 73ca5f86..360d6b66 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -5,7 +5,7 @@ #include "proj.h" #define USE_PJ_LIST_H 1 -#include "projects.h" +#include "proj_internal.h" /* Generate prototypes for projection functions */ diff --git a/src/log.cpp b/src/log.cpp index 0f81dc13..4c15772b 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -31,7 +31,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /************************************************************************/ /* pj_stderr_logger() */ diff --git a/src/malloc.cpp b/src/malloc.cpp index a14b1727..6bd4639e 100644 --- a/src/malloc.cpp +++ b/src/malloc.cpp @@ -47,7 +47,7 @@ #include <new> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /**********************************************************************/ void *pj_malloc(size_t size) { diff --git a/src/mk_cheby.cpp b/src/mk_cheby.cpp index 62528a41..0f3b97ed 100644 --- a/src/mk_cheby.cpp +++ b/src/mk_cheby.cpp @@ -1,5 +1,5 @@ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static void /* sum coefficients less than res */ eval(PJ_UV **w, int nu, int nv, double res, PJ_UV *resid) { int i, j; diff --git a/src/mlfn.cpp b/src/mlfn.cpp index e6bbd152..a5448e3b 100644 --- a/src/mlfn.cpp +++ b/src/mlfn.cpp @@ -1,7 +1,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* meridional distance for ellipsoid and inverse ** 8th degree - accurate to < 1e-5 meters when used in conjunction diff --git a/src/msfn.cpp b/src/msfn.cpp index cf6accf1..74506317 100644 --- a/src/msfn.cpp +++ b/src/msfn.cpp @@ -1,7 +1,7 @@ /* determine constant small m */ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" double pj_msfn(double sinphi, double cosphi, double es) { return (cosphi / sqrt (1. - es * sinphi * sinphi)); diff --git a/src/mutex.cpp b/src/mutex.cpp index 857c8bb4..12251f0f 100644 --- a/src/mutex.cpp +++ b/src/mutex.cpp @@ -41,7 +41,7 @@ #include "proj.h" #ifndef _WIN32 #include "proj_config.h" -#include "projects.h" +#include "proj_internal.h" #else #ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H diff --git a/src/nad_cvt.cpp b/src/nad_cvt.cpp index 91615bfa..76d2ccd0 100644 --- a/src/nad_cvt.cpp +++ b/src/nad_cvt.cpp @@ -4,7 +4,7 @@ #include <stdlib.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" #define MAX_ITERATIONS 10 diff --git a/src/nad_init.cpp b/src/nad_init.cpp index 695fa973..b29f7f0e 100644 --- a/src/nad_init.cpp +++ b/src/nad_init.cpp @@ -34,7 +34,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /************************************************************************/ /* swap_words() */ diff --git a/src/nad_intr.cpp b/src/nad_intr.cpp index 92d3292b..2c301ef8 100644 --- a/src/nad_intr.cpp +++ b/src/nad_intr.cpp @@ -3,7 +3,7 @@ #include "proj_internal.h" #include "proj_math.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PJ_LP nad_intr(PJ_LP t, struct CTABLE *ct) { PJ_LP val, frct; diff --git a/src/open_lib.cpp b/src/open_lib.cpp index c75b4af6..f4fa313f 100644 --- a/src/open_lib.cpp +++ b/src/open_lib.cpp @@ -37,7 +37,7 @@ #include <string.h> #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" static const char *(*pj_finder)(const char *) = nullptr; static int path_count = 0; diff --git a/src/param.cpp b/src/param.cpp index 22d21cf4..8125d62f 100644 --- a/src/param.cpp +++ b/src/param.cpp @@ -7,7 +7,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* create parameter list entry */ paralist *pj_mkparam(const char *str) { diff --git a/src/phi2.cpp b/src/phi2.cpp index 1f7b0846..afabd06e 100644 --- a/src/phi2.cpp +++ b/src/phi2.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static const double TOL = 1.0e-10; static const int N_ITER = 15; diff --git a/src/pipeline.cpp b/src/pipeline.cpp index 23d8f969..4b4ba3a7 100644 --- a/src/pipeline.cpp +++ b/src/pipeline.cpp @@ -104,7 +104,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-20 #include "geodesic.h" #include "proj.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(pipeline, "Transformation pipeline manager"); diff --git a/src/pr_list.cpp b/src/pr_list.cpp index 2ff91332..77db5bfb 100644 --- a/src/pr_list.cpp +++ b/src/pr_list.cpp @@ -5,7 +5,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #define LINE_LEN 72 static int @@ -113,12 +113,11 @@ * DEALINGS IN THE SOFTWARE. *****************************************************************************/ -#include <stddef.h> /* For size_t */ +#ifndef PROJ_H +#define PROJ_H +#include <stddef.h> /* For size_t */ -#ifdef PROJECTS_H -#error proj.h must be included before projects.h -#endif #ifdef PROJ_API_H #error proj.h must be included before proj_api.h #endif @@ -127,8 +126,6 @@ #include "proj_symbol_rename.h" #endif -#ifndef PROJ_H -#define PROJ_H #ifdef __cplusplus extern "C" { #endif diff --git a/src/proj_experimental.h b/src/proj_experimental.h index 31600e67..10faccd4 100644 --- a/src/proj_experimental.h +++ b/src/proj_experimental.h @@ -26,14 +26,15 @@ * DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "proj.h" - #ifndef PROJ_EXPERIMENTAL_H #define PROJ_EXPERIMENTAL_H + #ifdef __cplusplus extern "C" { #endif +#include "proj.h" + /** * \file proj_experimental.h * diff --git a/src/proj_internal.h b/src/proj_internal.h index d5c807fb..93edae5e 100644 --- a/src/proj_internal.h +++ b/src/proj_internal.h @@ -26,20 +26,45 @@ * DEALINGS IN THE SOFTWARE. *****************************************************************************/ -#ifdef _MSC_VER -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES +#ifndef PROJ_INTERNAL_H +#define PROJ_INTERNAL_H + +#ifndef __cplusplus +#error "proj_internal.h can only be included from a C++ file" #endif + +#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H +#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H +#endif + +#ifdef _MSC_VER +# ifndef _CRT_SECURE_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE +# endif +# ifndef _CRT_NONSTDC_NO_DEPRECATE +# define _CRT_NONSTDC_NO_DEPRECATE +# endif +/* enable predefined math constants M_* for MS Visual Studio workaround */ +# ifndef _USE_MATH_DEFINES +# define _USE_MATH_DEFINES +# endif #endif -#include <math.h> /* For M_PI */ +/* standard inclusions */ +#include <limits.h> +#include <math.h> #include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "proj/common.hpp" +#include "proj/coordinateoperation.hpp" +#include <string> +#include <vector> #include "proj.h" -#ifdef PROJECTS_H -#error proj_internal.h must be included before projects.h -#endif #ifdef PROJ_API_H #error proj_internal.h must be included before proj_api.h #endif @@ -48,12 +73,6 @@ #include "proj_symbol_rename.h" #endif -#ifndef PROJ_INTERNAL_H -#define PROJ_INTERNAL_H -#ifdef __cplusplus -extern "C" { -#endif - #define STATIC_ASSERT(COND) ((void)sizeof(char[(COND) ? 1 : -1])) #if !defined(HAVE_C99_MATH) @@ -70,6 +89,89 @@ extern "C" { /* Maximum latitudinal overshoot accepted */ #define PJ_EPS_LAT 1e-12 +#define C_NAMESPACE extern "C" +#define C_NAMESPACE_VAR extern "C" + +#ifndef NULL +# define NULL 0 +#endif + +#ifndef FALSE +# define FALSE 0 +#endif + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifndef MAX +# define MIN(a,b) ((a<b) ? a : b) +# define MAX(a,b) ((a>b) ? a : b) +#endif + +#ifndef ABS +# define ABS(x) ((x<0) ? (-1*(x)) : x) +#endif + +#if INT_MAX == 2147483647 +typedef int pj_int32; +#elif LONG_MAX == 2147483647 +typedef long pj_int32; +#else +#warning It seems no 32-bit integer type is available +#endif + +/* maximum path/filename */ +#ifndef MAX_PATH_FILENAME +#define MAX_PATH_FILENAME 1024 +#endif + +/* If we still haven't got M_PI*, we rely on our own defines. + * For example, this is necessary when compiling with gcc and + * the -ansi flag. + */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#define M_PI_2 1.57079632679489661923 +#define M_PI_4 0.78539816339744830962 +#define M_2_PI 0.63661977236758134308 +#endif + +/* M_SQRT2 might be missing */ +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 +#endif + +/* some more useful math constants and aliases */ +#define M_FORTPI M_PI_4 /* pi/4 */ +#define M_HALFPI M_PI_2 /* pi/2 */ +#define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */ +#define M_TWOPI 6.28318530717958647693 /* 2*pi */ +#define M_TWO_D_PI M_2_PI /* 2/pi */ +#define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */ + + +/* maximum tag id length for +init and default files */ +#ifndef ID_TAG_MAX +#define ID_TAG_MAX 50 +#endif + +/* Use WIN32 as a standard windows 32 bit declaration */ +#if defined(_WIN32) && !defined(WIN32) +# define WIN32 +#endif + +#if defined(_WINDOWS) && !defined(WIN32) +# define WIN32 +#endif + +/* directory delimiter for DOS support */ +#ifdef WIN32 +#define DIR_CHAR '\\' +#else +#define DIR_CHAR '/' +#endif + /* This enum is also conditionally defined in projects.h - but enums cannot */ /* be forward declared and we need it here for the pj_left/right prototypes */ @@ -132,8 +234,667 @@ void proj_fileapi_set (PJ *P, void *fileapi); const char * const *proj_get_searchpath(void); int proj_get_path_count(void); -#ifdef __cplusplus -} +typedef struct { double r, i; } COMPLEX; + +/* Forward declarations and typedefs for stuff needed inside the PJ object */ +struct PJconsts; + +union PJ_COORD; +struct geod_geodesic; +struct ARG_list; +struct PJ_REGION_S; +typedef struct PJ_REGION_S PJ_Region; +typedef struct ARG_list paralist; /* parameter list */ +#ifndef PROJ_INTERNAL_H +enum pj_io_units { + PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */ + PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */ + PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */ + PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */ + PJ_IO_UNITS_ANGULAR = 4 /* Radians */ +}; +#endif +#ifndef PROJ_H +typedef struct PJconsts PJ; /* the PJ object herself */ +typedef union PJ_COORD PJ_COORD; +#endif + +struct PJ_REGION_S { + double ll_long; /* lower left corner coordinates (radians) */ + double ll_lat; + double ur_long; /* upper right corner coordinates (radians) */ + double ur_lat; +}; + +struct PJ_AREA { + int bbox_set; + double west_lon_degree; + double south_lat_degree; + double east_lon_degree; + double north_lat_degree; +}; + +struct projCtx_t; +typedef struct projCtx_t projCtx_t; + +/***************************************************************************** + + Some function types that are especially useful when working with PJs + +****************************************************************************** + +PJ_CONSTRUCTOR: + + A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ. + Historically called twice: First with a 0 argument, to allocate memory, + second with the first return value as argument, for actual setup. + +PJ_DESTRUCTOR: + + A function taking a pointer-to-PJ and an integer as args, then first + handling the deallocation of the PJ, afterwards handing the integer over + to the error reporting subsystem, and finally returning a null pointer in + support of the "return free (P)" (aka "get the hell out of here") idiom. + +PJ_OPERATOR: + + A function taking a PJ_COORD and a pointer-to-PJ as args, applying the + PJ to the PJ_COORD, and returning the resulting PJ_COORD. + +*****************************************************************************/ +typedef PJ *(* PJ_CONSTRUCTOR) (PJ *); +typedef PJ *(* PJ_DESTRUCTOR) (PJ *, int); +typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *); +/****************************************************************************/ + + +/* datum_type values */ +#define PJD_UNKNOWN 0 +#define PJD_3PARAM 1 +#define PJD_7PARAM 2 +#define PJD_GRIDSHIFT 3 +#define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */ + + +/* base projection data structure */ +struct PJconsts { + + /************************************************************************************* + + G E N E R A L P A R A M E T E R S T R U C T + + ************************************************************************************** + + TODO: Need some description here - especially about the thread context... + This is the struct behind the PJ typedef + + **************************************************************************************/ + + projCtx_t *ctx = nullptr; + const char *descr = nullptr; /* From pj_list.h or individual PJ_*.c file */ + paralist *params = nullptr; /* Parameter list */ + char *def_full = nullptr; /* Full textual definition (usually 0 - set by proj_pj_info) */ + char *def_size = nullptr; /* Shape and size parameters extracted from params */ + char *def_shape = nullptr; + char *def_spherification = nullptr; + char *def_ellps = nullptr; + + struct geod_geodesic *geod = nullptr; /* For geodesic computations */ + void *opaque = nullptr; /* Projection specific parameters, Defined in PJ_*.c */ + int inverted = 0; /* Tell high level API functions to swap inv/fwd */ + + + /************************************************************************************* + + F U N C T I O N P O I N T E R S + + ************************************************************************************** + + For projection xxx, these are pointers to functions in the corresponding + PJ_xxx.c file. + + pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(), + a name which is currently hidden behind the magic curtain of the PROJECTION + macro. + + **************************************************************************************/ + + + 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; + + PJ_DESTRUCTOR destructor = nullptr; + + + /************************************************************************************* + + E L L I P S O I D P A R A M E T E R S + + ************************************************************************************** + + Despite YAGNI, we add a large number of ellipsoidal shape parameters, which + are not yet set up in pj_init. They are, however, inexpensive to compute, + compared to the overall time taken for setting up the complex PJ object + (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity). + + But during single point projections it will often be a useful thing to have + these readily available without having to recompute at every pj_fwd / pj_inv + call. + + With this wide selection, we should be ready for quite a number of geodetic + algorithms, without having to incur further ABI breakage. + + **************************************************************************************/ + + /* The linear parameters */ + + double a = 0.0; /* semimajor axis (radius if eccentricity==0) */ + double b = 0.0; /* semiminor axis */ + double ra = 0.0; /* 1/a */ + double rb = 0.0; /* 1/b */ + + /* The eccentricities */ + + double alpha = 0.0; /* angular eccentricity */ + double e = 0.0; /* first eccentricity */ + double es = 0.0; /* first eccentricity squared */ + double e2 = 0.0; /* second eccentricity */ + double e2s = 0.0; /* second eccentricity squared */ + double e3 = 0.0; /* third eccentricity */ + double e3s = 0.0; /* third eccentricity squared */ + double one_es = 0.0; /* 1 - e^2 */ + double rone_es = 0.0; /* 1/one_es */ + + + /* The flattenings */ + double f = 0.0; /* first flattening */ + double f2 = 0.0; /* second flattening */ + double n = 0.0; /* third flattening */ + double rf = 0.0; /* 1/f */ + double rf2 = 0.0; /* 1/f2 */ + double rn = 0.0; /* 1/n */ + + /* This one's for GRS80 */ + double J = 0.0; /* "Dynamic form factor" */ + + double es_orig = 0.0; /* es and a before any +proj related adjustment */ + double a_orig = 0.0; + + + /************************************************************************************* + + C O O R D I N A T E H A N D L I N G + + **************************************************************************************/ + + int over = 0; /* Over-range flag */ + int geoc = 0; /* Geocentric latitude flag */ + int is_latlong = 0; /* proj=latlong ... not really a projection at all */ + int is_geocent = 0; /* proj=geocent ... not really a projection at all */ + int is_pipeline = 0; /* 1 if PJ represents a pipeline */ + int need_ellps = 0; /* 0 for operations that are purely cartesian */ + int skip_fwd_prepare = 0; + int skip_fwd_finalize = 0; + int skip_inv_prepare = 0; + int skip_inv_finalize = 0; + + enum pj_io_units left = PJ_IO_UNITS_WHATEVER; /* Flags for input/output coordinate types */ + enum pj_io_units right = PJ_IO_UNITS_WHATEVER; + + /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */ + PJ *axisswap = nullptr; + PJ *cart = nullptr; + PJ *cart_wgs84 = nullptr; + PJ *helmert = nullptr; + PJ *hgridshift = nullptr; + PJ *vgridshift = nullptr; + + + /************************************************************************************* + + C A R T O G R A P H I C O F F S E T S + + **************************************************************************************/ + + double lam0 = 0.0; /* central meridian */ + double phi0 = 0.0; /* central parallel */ + double x0 = 0.0; /* false easting */ + double y0 = 0.0; /* false northing */ + double z0 = 0.0; /* height origin */ + double t0 = 0.0; /* time origin */ + + + /************************************************************************************* + + S C A L I N G + + **************************************************************************************/ + + double k0 = 0.0; /* General scaling factor - e.g. the 0.9996 of UTM */ + double to_meter = 0.0, fr_meter = 0.0; /* Plane coordinate scaling. Internal unit [m] */ + double vto_meter = 0.0, vfr_meter = 0.0; /* Vertical scaling. Internal unit [m] */ + + + /************************************************************************************* + + D A T U M S A N D H E I G H T S Y S T E M S + + ************************************************************************************** + + It may be possible, and meaningful, to move the list parts of this up to the + PJ_CONTEXT level. + + **************************************************************************************/ + + int datum_type = PJD_UNKNOWN; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ + double datum_params[7] = {0,0,0,0,0,0,0}; /* Parameters for 3PARAM and 7PARAM */ + struct _pj_gi **gridlist = nullptr; /* TODO: Description needed */ + int gridlist_count = 0; + + int has_geoid_vgrids = 0; /* TODO: Description needed */ + struct _pj_gi **vgridlist_geoid = nullptr; /* TODO: Description needed */ + int vgridlist_geoid_count = 0; + + double from_greenwich = 0.0; /* prime meridian offset (in radians) */ + double long_wrap_center = 0.0; /* 0.0 for -180 to 180, actually in radians*/ + int is_long_wrap_set = 0; + char axis[4] = {0,0,0,0}; /* Axis order, pj_transform/pj_adjust_axis */ + + /* New Datum Shift Grid Catalogs */ + char *catalog_name = nullptr; + struct _PJ_GridCatalog *catalog = nullptr; + + double datum_date = 0.0; /* TODO: Description needed */ + + struct _pj_gi *last_before_grid = nullptr; /* TODO: Description needed */ + PJ_Region last_before_region = {0,0,0,0}; /* TODO: Description needed */ + double last_before_date = 0.0; /* TODO: Description needed */ + + struct _pj_gi *last_after_grid = nullptr; /* TODO: Description needed */ + PJ_Region last_after_region = {0,0,0,0}; /* TODO: Description needed */ + double last_after_date = 0.0; /* TODO: Description needed */ + + /************************************************************************************* + ISO-19111 interface + **************************************************************************************/ + + NS_PROJ::common::IdentifiedObjectPtr iso_obj{}; + + // cached results + mutable std::string lastWKT{}; + mutable std::string lastPROJString{}; + mutable bool gridsNeededAsked = false; + mutable std::vector<NS_PROJ::operation::GridDescription> gridsNeeded{}; + + /************************************************************************************* + + E N D O F G E N E R A L P A R A M E T E R S T R U C T + + **************************************************************************************/ + + PJconsts(); + PJconsts(const PJconsts &) = delete; + PJconsts &operator=(const PJconsts &) = delete; +}; + + + + +/* Parameter list (a copy of the +proj=... etc. parameters) */ +struct ARG_list { + paralist *next; + char used; +#if defined(__GNUC__) && __GNUC__ >= 8 + char param[]; /* variable-length member */ + /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */ + /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */ +#else + char param[1]; /* variable-length member */ #endif +}; + + +typedef union { double f; int i; char *s; } PROJVALUE; + + +struct PJ_DATUMS { + const char *id; /* datum keyword */ + const char *defn; /* ie. "to_wgs84=..." */ + const char *ellipse_id; /* ie from ellipse table */ + const char *comments; /* EPSG code, etc */ +}; + + +struct DERIVS { + double x_l, x_p; /* derivatives of x for lambda-phi */ + double y_l, y_p; /* derivatives of y for lambda-phi */ +}; + +struct FACTORS { + struct DERIVS der; + double h, k; /* meridional, parallel scales */ + double omega, thetap; /* angular distortion, theta prime */ + double conv; /* convergence */ + double s; /* areal scale factor */ + double a, b; /* max-min scale error */ + int code; /* always 0 */ +}; + +/* library errors */ +#define PJD_ERR_NO_ARGS -1 +#define PJD_ERR_NO_OPTION_IN_INIT_FILE -2 +#define PJD_ERR_NO_COLON_IN_INIT_STRING -3 +#define PJD_ERR_PROJ_NOT_NAMED -4 +#define PJD_ERR_UNKNOWN_PROJECTION_ID -5 +#define PJD_ERR_ECCENTRICITY_IS_ONE -6 +#define PJD_ERR_UNKNOWN_UNIT_ID -7 +#define PJD_ERR_INVALID_BOOLEAN_PARAM -8 +#define PJD_ERR_UNKNOWN_ELLP_PARAM -9 +#define PJD_ERR_REV_FLATTENING_IS_ZERO -10 +#define PJD_ERR_REF_RAD_LARGER_THAN_90 -11 +#define PJD_ERR_ES_LESS_THAN_ZERO -12 +#define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13 +#define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14 +#define PJD_ERR_INVALID_X_OR_Y -15 +#define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16 +#define PJD_ERR_NON_CONV_INV_MERI_DIST -17 +#define PJD_ERR_NON_CON_INV_PHI2 -18 +#define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19 +#define PJD_ERR_TOLERANCE_CONDITION -20 +#define PJD_ERR_CONIC_LAT_EQUAL -21 +#define PJD_ERR_LAT_LARGER_THAN_90 -22 +#define PJD_ERR_LAT1_IS_ZERO -23 +#define PJD_ERR_LAT_TS_LARGER_THAN_90 -24 +#define PJD_ERR_CONTROL_POINT_NO_DIST -25 +#define PJD_ERR_NO_ROTATION_PROJ -26 +#define PJD_ERR_W_OR_M_ZERO_OR_LESS -27 +#define PJD_ERR_LSAT_NOT_IN_RANGE -28 +#define PJD_ERR_PATH_NOT_IN_RANGE -29 +#define PJD_ERR_H_LESS_THAN_ZERO -30 +#define PJD_ERR_K_LESS_THAN_ZERO -31 +#define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32 +#define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33 +#define PJD_ERR_ELLIPSOID_USE_REQUIRED -34 +#define PJD_ERR_INVALID_UTM_ZONE -35 +#define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36 +#define PJD_ERR_FAILED_TO_FIND_PROJ -37 +#define PJD_ERR_FAILED_TO_LOAD_GRID -38 +#define PJD_ERR_INVALID_M_OR_N -39 +#define PJD_ERR_N_OUT_OF_RANGE -40 +#define PJD_ERR_LAT_1_2_UNSPECIFIED -41 +#define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42 +#define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43 +#define PJD_ERR_UNPARSEABLE_CS_DEF -44 +#define PJD_ERR_GEOCENTRIC -45 +#define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46 +#define PJD_ERR_AXIS -47 +#define PJD_ERR_GRID_AREA -48 +#define PJD_ERR_INVALID_SWEEP_AXIS -49 +#define PJD_ERR_MALFORMED_PIPELINE -50 +#define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51 +#define PJD_ERR_INVALID_SCALE -52 +#define PJD_ERR_NON_CONVERGENT -53 +#define PJD_ERR_MISSING_ARGS -54 +#define PJD_ERR_LAT_0_IS_ZERO -55 +#define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56 +#define PJD_ERR_TOO_MANY_INITS -57 +#define PJD_ERR_INVALID_ARG -58 +#define PJD_ERR_INCONSISTENT_UNIT -59 +/* NOTE: Remember to update pj_strerrno.c and transient_error in */ +/* pj_transform.c when adding new value */ + +struct projFileAPI_t; + +struct projCppContext; + +/* proj thread context */ +struct projCtx_t { + int last_errno; + int debug_level; + void (*logger)(void *, int, const char *); + void *app_data; + struct projFileAPI_t *fileapi; + struct projCppContext* cpp_context; /* internal context for C++ code */ + int use_proj4_init_rules; /* -1 = unknown, 0 = no, 1 = yes */ + int epsg_file_exists; /* -1 = unknown, 0 = no, 1 = yes */ +}; + +/* classic public API */ +#include "proj_api.h" + + +/* Generate pj_list external or make list from include file */ +#ifndef PJ_DATUMS__ +C_NAMESPACE_VAR struct PJ_DATUMS pj_datums[]; +#endif + + + + + +#ifdef PJ_LIB__ +#define PROJ_HEAD(name, desc) static const char des_##name [] = desc + +#define OPERATION(name, NEED_ELPJ_LPS) \ + \ +pj_projection_specific_setup_##name (PJ *P); \ +C_NAMESPACE PJ *pj_##name (PJ *P); \ + \ +C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \ + \ +C_NAMESPACE PJ *pj_##name (PJ *P) { \ + if (P) \ + return pj_projection_specific_setup_##name (P); \ + P = pj_new(); \ + if (nullptr==P) \ + return nullptr; \ + P->descr = des_##name; \ + P->need_ellps = NEED_ELPJ_LPS; \ + P->left = PJ_IO_UNITS_ANGULAR; \ + P->right = PJ_IO_UNITS_CLASSIC; \ + return P; \ +} \ + \ +PJ *pj_projection_specific_setup_##name (PJ *P) + +/* In ISO19000 lingo, an operation is either a conversion or a transformation */ +#define CONVERSION(name, need_ellps) OPERATION (name, need_ellps) +#define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps) + +/* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */ +#define PROJECTION(name) CONVERSION (name, 1) + +#endif /* def PJ_LIB__ */ + + +#define MAX_TAB_ID 80 +typedef struct { float lam, phi; } FLP; +typedef struct { pj_int32 lam, phi; } ILP; + +struct CTABLE { + char id[MAX_TAB_ID]; /* ascii info */ + PJ_LP ll; /* lower left corner coordinates */ + PJ_LP del; /* size of cells */ + ILP lim; /* limits of conversion matrix */ + FLP *cvs; /* conversion matrix */ +}; + +typedef struct _pj_gi { + char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */ + char *filename; /* full path to filename */ + + const char *format; /* format of this grid, ie "ctable", "ntv1", + "ntv2" or "missing". */ + + long grid_offset; /* offset in file, for delayed loading */ + int must_swap; /* only for NTv2 */ + + struct CTABLE *ct; + + struct _pj_gi *next; + struct _pj_gi *child; +} PJ_GRIDINFO; + +typedef struct { + PJ_Region region; + int priority; /* higher used before lower */ + double date; /* year.fraction */ + char *definition; /* usually the gridname */ + + PJ_GRIDINFO *gridinfo; + int available; /* 0=unknown, 1=true, -1=false */ +} PJ_GridCatalogEntry; + +typedef struct _PJ_GridCatalog { + char *catalog_name; + + PJ_Region region; /* maximum extent of catalog data */ + + int entry_count; + PJ_GridCatalogEntry *entries; + + struct _PJ_GridCatalog *next; +} PJ_GridCatalog; + +/* procedure prototypes */ +double PROJ_DLL dmstor(const char *, char **); +double dmstor_ctx(projCtx ctx, const char *, char **); +void PROJ_DLL set_rtodms(int, int); +char PROJ_DLL *rtodms(char *, double, int, int); +double PROJ_DLL adjlon(double); +double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double); + +PROJVALUE PROJ_DLL pj_param(projCtx ctx, paralist *, const char *); +paralist PROJ_DLL *pj_param_exists (paralist *list, const char *parameter); +paralist PROJ_DLL *pj_mkparam(const char *); +paralist *pj_mkparam_ws (const char *str); + + +int PROJ_DLL pj_ell_set(projCtx ctx, paralist *, double *, double *); +int pj_datum_set(projCtx,paralist *, PJ *); +int pj_angular_units_set(paralist *, PJ *); + +paralist *pj_clone_paralist( const paralist* ); +paralist *pj_search_initcache( const char *filekey ); +void pj_insert_initcache( const char *filekey, const paralist *list); +paralist *pj_expand_init(projCtx ctx, paralist *init); + +void *pj_dealloc_params (projCtx ctx, paralist *start, int errlev); + + +double *pj_enfn(double); +double pj_mlfn(double, double, double, double *); +double pj_inv_mlfn(projCtx, double, double, double *); +double pj_qsfn(double, double, double); +double pj_tsfn(double, double, double); +double pj_msfn(double, double, double); +double PROJ_DLL pj_phi2(projCtx, double, double); +double pj_qsfn_(double, PJ *); +double *pj_authset(double); +double pj_authlat(double, double *); + +COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int); +COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *); + +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) */ + double *c; /* power coefficients */ +}; + +/* Approximation structures and procedures */ +typedef struct { /* Chebyshev or Power series structure */ + 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(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(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 */ +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 ); +struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid ); +int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid ); +void nad_free(struct CTABLE *); + +/* higher level handling of datum grid shift files */ + +int pj_apply_vgridshift( PJ *defn, const char *listname, + PJ_GRIDINFO ***gridlist_p, + int *gridlist_count_p, + int inverse, + long point_count, int point_offset, + double *x, double *y, double *z ); +int pj_apply_gridshift_2( PJ *defn, int inverse, + long point_count, int point_offset, + double *x, double *y, double *z ); +int pj_apply_gridshift_3( projCtx ctx, + PJ_GRIDINFO **gridlist, int gridlist_count, + int inverse, long point_count, int point_offset, + double *x, double *y, double *z ); + +PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * ); +void PROJ_DLL pj_deallocate_grids(); + +PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * ); +int pj_gridinfo_load( projCtx, PJ_GRIDINFO * ); +void pj_gridinfo_free( projCtx, PJ_GRIDINFO * ); + +PJ_GridCatalog *pj_gc_findcatalog( projCtx, const char * ); +PJ_GridCatalog *pj_gc_readcatalog( projCtx, const char * ); +void pj_gc_unloadall( projCtx ); +int pj_gc_apply_gridshift( PJ *defn, int inverse, + long point_count, int point_offset, + double *x, double *y, double *z ); +int pj_gc_apply_gridshift( PJ *defn, int inverse, + long point_count, int point_offset, + double *x, double *y, double *z ); + +PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, + PJ_GridCatalog *catalog, int after, + PJ_LP location, double date, + PJ_Region *optional_region, + double *grid_date ); + +double pj_gc_parsedate( projCtx, const char * ); + +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 *); +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 ); + +PJ *pj_new(void); +PJ *pj_default_destructor (PJ *P, int errlev); + +double PROJ_DLL pj_atof( const char* nptr ); +double pj_strtod( const char *nptr, char **endptr ); +void pj_freeup_plain (PJ *P); + +projPJ pj_init_ctx_with_allow_init_epsg( projCtx ctx, int argc, char **argv, int allow_init_epsg ); + #endif /* ndef PROJ_INTERNAL_H */ diff --git a/src/proj_mdist.cpp b/src/proj_mdist.cpp index e7acedcc..d15a692c 100644 --- a/src/proj_mdist.cpp +++ b/src/proj_mdist.cpp @@ -33,7 +33,7 @@ #include <stdlib.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #define MAX_ITER 20 #define TOL 1e-14 diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp index 2b7f7238..9a0c4656 100644 --- a/src/projections/aea.cpp +++ b/src/projections/aea.cpp @@ -30,7 +30,7 @@ #define PJ_LIB__ #include "proj.h" #include <errno.h> -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" diff --git a/src/projections/aeqd.cpp b/src/projections/aeqd.cpp index f92ecd81..8566062d 100644 --- a/src/projections/aeqd.cpp +++ b/src/projections/aeqd.cpp @@ -29,7 +29,7 @@ #include "geodesic.h" #include "proj.h" #include <errno.h> -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" namespace { // anonymous namespace diff --git a/src/projections/airy.cpp b/src/projections/airy.cpp index 9421edc9..f7068061 100644 --- a/src/projections/airy.cpp +++ b/src/projections/airy.cpp @@ -29,7 +29,7 @@ #define PJ_LIB__ #include "proj.h" #include <errno.h> -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(airy, "Airy") "\n\tMisc Sph, no inv\n\tno_cut lat_b="; diff --git a/src/projections/aitoff.cpp b/src/projections/aitoff.cpp index 9388b75a..127841ff 100644 --- a/src/projections/aitoff.cpp +++ b/src/projections/aitoff.cpp @@ -34,7 +34,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace diff --git a/src/projections/august.cpp b/src/projections/august.cpp index f7c24e3a..3523034e 100644 --- a/src/projections/august.cpp +++ b/src/projections/august.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(august, "August Epicycloidal") "\n\tMisc Sph, no inv"; #define M 1.333333333333333 diff --git a/src/projections/bacon.cpp b/src/projections/bacon.cpp index 74337ff2..c713a989 100644 --- a/src/projections/bacon.cpp +++ b/src/projections/bacon.cpp @@ -5,7 +5,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace diff --git a/src/projections/bertin1953.cpp b/src/projections/bertin1953.cpp index 41301e7d..96de6d4b 100644 --- a/src/projections/bertin1953.cpp +++ b/src/projections/bertin1953.cpp @@ -16,7 +16,7 @@ #include "proj_internal.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(bertin1953, "Bertin 1953") "\n\tMisc Sph no inv."; diff --git a/src/projections/bipc.cpp b/src/projections/bipc.cpp index d0b77092..5cfef11f 100644 --- a/src/projections/bipc.cpp +++ b/src/projections/bipc.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(bipc, "Bipolar conic of western hemisphere") "\n\tConic Sph"; diff --git a/src/projections/boggs.cpp b/src/projections/boggs.cpp index df5afbd2..5502d493 100644 --- a/src/projections/boggs.cpp +++ b/src/projections/boggs.cpp @@ -2,7 +2,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl, no inv, Sph"; # define NITER 20 diff --git a/src/projections/bonne.cpp b/src/projections/bonne.cpp index 2004c6e9..0e9bae79 100644 --- a/src/projections/bonne.cpp +++ b/src/projections/bonne.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" diff --git a/src/projections/calcofi.cpp b/src/projections/calcofi.cpp index 2ca79553..e81843b4 100644 --- a/src/projections/calcofi.cpp +++ b/src/projections/calcofi.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_api.h" PROJ_HEAD(calcofi, diff --git a/src/projections/cass.cpp b/src/projections/cass.cpp index 7afa2bd8..ee050548 100644 --- a/src/projections/cass.cpp +++ b/src/projections/cass.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(cass, "Cassini") "\n\tCyl, Sph&Ell"; diff --git a/src/projections/cc.cpp b/src/projections/cc.cpp index 7ac886f0..559a4f1a 100644 --- a/src/projections/cc.cpp +++ b/src/projections/cc.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph"; #define EPS10 1.e-10 diff --git a/src/projections/ccon.cpp b/src/projections/ccon.cpp index 4513a6f9..5f5128cf 100644 --- a/src/projections/ccon.cpp +++ b/src/projections/ccon.cpp @@ -23,7 +23,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" #define EPS10 1e-10 diff --git a/src/projections/cea.cpp b/src/projections/cea.cpp index 4abb5543..a1c9c8b5 100644 --- a/src/projections/cea.cpp +++ b/src/projections/cea.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/chamb.cpp b/src/projections/chamb.cpp index c62e35f1..33a38781 100644 --- a/src/projections/chamb.cpp +++ b/src/projections/chamb.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" typedef struct { double r, Az; } VECT; namespace { // anonymous namespace diff --git a/src/projections/collg.cpp b/src/projections/collg.cpp index 5f4de7c6..b22e1bf2 100644 --- a/src/projections/collg.cpp +++ b/src/projections/collg.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph"; #define FXC 1.12837916709551257390 diff --git a/src/projections/comill.cpp b/src/projections/comill.cpp index dd0ce5c0..3af19b42 100644 --- a/src/projections/comill.cpp +++ b/src/projections/comill.cpp @@ -11,7 +11,7 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016 #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(comill, "Compact Miller") "\n\tCyl, Sph"; diff --git a/src/projections/crast.cpp b/src/projections/crast.cpp index 76846dbe..35272058 100644 --- a/src/projections/crast.cpp +++ b/src/projections/crast.cpp @@ -2,7 +2,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph"; diff --git a/src/projections/denoy.cpp b/src/projections/denoy.cpp index d10d8881..1560ad6b 100644 --- a/src/projections/denoy.cpp +++ b/src/projections/denoy.cpp @@ -2,7 +2,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl, no inv, Sph"; diff --git a/src/projections/eck1.cpp b/src/projections/eck1.cpp index d8dbc2c5..3a19796e 100644 --- a/src/projections/eck1.cpp +++ b/src/projections/eck1.cpp @@ -2,7 +2,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl, Sph"; #define FC 0.92131773192356127802 diff --git a/src/projections/eck2.cpp b/src/projections/eck2.cpp index efedf8b7..f019fdab 100644 --- a/src/projections/eck2.cpp +++ b/src/projections/eck2.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl, Sph"; diff --git a/src/projections/eck3.cpp b/src/projections/eck3.cpp index 71163083..6777c765 100644 --- a/src/projections/eck3.cpp +++ b/src/projections/eck3.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(eck3, "Eckert III") "\n\tPCyl, Sph"; PROJ_HEAD(putp1, "Putnins P1") "\n\tPCyl, Sph"; diff --git a/src/projections/eck4.cpp b/src/projections/eck4.cpp index 64a1158f..7f8203b2 100644 --- a/src/projections/eck4.cpp +++ b/src/projections/eck4.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph"; diff --git a/src/projections/eck5.cpp b/src/projections/eck5.cpp index ab207aab..40e9d3bb 100644 --- a/src/projections/eck5.cpp +++ b/src/projections/eck5.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph"; diff --git a/src/projections/eqc.cpp b/src/projections/eqc.cpp index f7a0eede..eb021eac 100644 --- a/src/projections/eqc.cpp +++ b/src/projections/eqc.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/eqdc.cpp b/src/projections/eqdc.cpp index 1aa037a6..d175d4a1 100644 --- a/src/projections/eqdc.cpp +++ b/src/projections/eqdc.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" namespace { // anonymous namespace diff --git a/src/projections/eqearth.cpp b/src/projections/eqearth.cpp index 96ea46ba..dc58eed9 100644 --- a/src/projections/eqearth.cpp +++ b/src/projections/eqearth.cpp @@ -17,7 +17,7 @@ Added ellipsoidal equations by Bojan Savric, 22 August 2018 #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(eqearth, "Equal Earth") "\n\tPCyl, Sph&Ell"; diff --git a/src/projections/etmerc.cpp b/src/projections/etmerc.cpp index 9b75c606..e75bc168 100644 --- a/src/projections/etmerc.cpp +++ b/src/projections/etmerc.cpp @@ -43,7 +43,7 @@ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" diff --git a/src/projections/fahey.cpp b/src/projections/fahey.cpp index bcce7eef..ba8cb8f9 100644 --- a/src/projections/fahey.cpp +++ b/src/projections/fahey.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(fahey, "Fahey") "\n\tPcyl, Sph"; diff --git a/src/projections/fouc_s.cpp b/src/projections/fouc_s.cpp index 08db782e..e91f41c3 100644 --- a/src/projections/fouc_s.cpp +++ b/src/projections/fouc_s.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(fouc_s, "Foucaut Sinusoidal") "\n\tPCyl, Sph"; diff --git a/src/projections/gall.cpp b/src/projections/gall.cpp index d3eba43c..8f1ca1f8 100644 --- a/src/projections/gall.cpp +++ b/src/projections/gall.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph"; diff --git a/src/projections/geos.cpp b/src/projections/geos.cpp index 1e6c2d69..cdb0244a 100644 --- a/src/projections/geos.cpp +++ b/src/projections/geos.cpp @@ -33,7 +33,7 @@ #include <stddef.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" namespace { // anonymous namespace diff --git a/src/projections/gins8.cpp b/src/projections/gins8.cpp index a8539db4..6f499889 100644 --- a/src/projections/gins8.cpp +++ b/src/projections/gins8.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph, no inv"; diff --git a/src/projections/gn_sinu.cpp b/src/projections/gn_sinu.cpp index f301e05c..3a591669 100644 --- a/src/projections/gn_sinu.cpp +++ b/src/projections/gn_sinu.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(gn_sinu, "General Sinusoidal Series") "\n\tPCyl, Sph\n\tm= n="; PROJ_HEAD(sinu, "Sinusoidal (Sanson-Flamsteed)") "\n\tPCyl, Sph&Ell"; diff --git a/src/projections/gnom.cpp b/src/projections/gnom.cpp index 513d9b42..bf454ba9 100644 --- a/src/projections/gnom.cpp +++ b/src/projections/gnom.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(gnom, "Gnomonic") "\n\tAzi, Sph"; diff --git a/src/projections/goode.cpp b/src/projections/goode.cpp index 2717a424..802df90c 100644 --- a/src/projections/goode.cpp +++ b/src/projections/goode.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(goode, "Goode Homolosine") "\n\tPCyl, Sph"; diff --git a/src/projections/gstmerc.cpp b/src/projections/gstmerc.cpp index 69087228..735d39e5 100644 --- a/src/projections/gstmerc.cpp +++ b/src/projections/gstmerc.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)") "\n\tCyl, Sph&Ell\n\tlat_0= lon_0= k_0="; diff --git a/src/projections/hammer.cpp b/src/projections/hammer.cpp index 4c230a48..aa7d1ba9 100644 --- a/src/projections/hammer.cpp +++ b/src/projections/hammer.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff") "\n\tMisc Sph, \n\tW= M="; diff --git a/src/projections/hatano.cpp b/src/projections/hatano.cpp index 33bea55b..b2ef6c6f 100644 --- a/src/projections/hatano.cpp +++ b/src/projections/hatano.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area") "\n\tPCyl, Sph"; diff --git a/src/projections/healpix.cpp b/src/projections/healpix.cpp index 72dac71c..8e4846ed 100644 --- a/src/projections/healpix.cpp +++ b/src/projections/healpix.cpp @@ -35,7 +35,7 @@ #include "proj_internal.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(healpix, "HEAPJ_LPix") "\n\tSph&Ell"; PROJ_HEAD(rhealpix, "rHEAPJ_LPix") "\n\tSph&Ell\n\tnorth_square= south_square="; diff --git a/src/projections/igh.cpp b/src/projections/igh.cpp index 1e1cdb01..a8efbb9d 100644 --- a/src/projections/igh.cpp +++ b/src/projections/igh.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(igh, "Interrupted Goode Homolosine") "\n\tPCyl, Sph"; diff --git a/src/projections/imw_p.cpp b/src/projections/imw_p.cpp index db82e660..723fcc48 100644 --- a/src/projections/imw_p.cpp +++ b/src/projections/imw_p.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(imw_p, "International Map of the World Polyconic") "\n\tMod. Polyconic, Ell\n\tlat_1= and lat_2= [lon_1=]"; diff --git a/src/projections/isea.cpp b/src/projections/isea.cpp index 3ce4b623..3a0a0a48 100644 --- a/src/projections/isea.cpp +++ b/src/projections/isea.cpp @@ -14,7 +14,7 @@ #include "proj_internal.h" #include "proj_math.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #define DEG36 0.62831853071795864768 #define DEG72 1.25663706143591729537 diff --git a/src/projections/krovak.cpp b/src/projections/krovak.cpp index 6bd98f79..591f8dcc 100644 --- a/src/projections/krovak.cpp +++ b/src/projections/krovak.cpp @@ -81,7 +81,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(krovak, "Krovak") "\n\tPCyl, Ell"; diff --git a/src/projections/labrd.cpp b/src/projections/labrd.cpp index 77120fa4..330c105f 100644 --- a/src/projections/labrd.cpp +++ b/src/projections/labrd.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(labrd, "Laborde") "\n\tCyl, Sph\n\tSpecial for Madagascar"; #define EPS 1.e-10 diff --git a/src/projections/laea.cpp b/src/projections/laea.cpp index cfdd1326..e3c7248a 100644 --- a/src/projections/laea.cpp +++ b/src/projections/laea.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(laea, "Lambert Azimuthal Equal Area") "\n\tAzi, Sph&Ell"; diff --git a/src/projections/lagrng.cpp b/src/projections/lagrng.cpp index c62b409b..65686584 100644 --- a/src/projections/lagrng.cpp +++ b/src/projections/lagrng.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(lagrng, "Lagrange") "\n\tMisc Sph\n\tW="; diff --git a/src/projections/larr.cpp b/src/projections/larr.cpp index 4ece694d..bab1dbf4 100644 --- a/src/projections/larr.cpp +++ b/src/projections/larr.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(larr, "Larrivee") "\n\tMisc Sph, no inv"; diff --git a/src/projections/lask.cpp b/src/projections/lask.cpp index d13a94e2..c4c6734d 100644 --- a/src/projections/lask.cpp +++ b/src/projections/lask.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv"; diff --git a/src/projections/latlong.cpp b/src/projections/latlong.cpp index 4d22ea5b..f114504b 100644 --- a/src/projections/latlong.cpp +++ b/src/projections/latlong.cpp @@ -30,7 +30,7 @@ /* very loosely based upon DMA code by Bradford W. Drew */ #define PJ_LIB__ #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t"; PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t"; diff --git a/src/projections/lcc.cpp b/src/projections/lcc.cpp index 1b00732f..a1fe79a9 100644 --- a/src/projections/lcc.cpp +++ b/src/projections/lcc.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(lcc, "Lambert Conformal Conic") diff --git a/src/projections/lcca.cpp b/src/projections/lcca.cpp index e475dd6d..d4dc8641 100644 --- a/src/projections/lcca.cpp +++ b/src/projections/lcca.cpp @@ -51,7 +51,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative") "\n\tConic, Sph&Ell\n\tlat_0="; diff --git a/src/projections/loxim.cpp b/src/projections/loxim.cpp index 9c55cfce..2a780a9e 100644 --- a/src/projections/loxim.cpp +++ b/src/projections/loxim.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(loxim, "Loximuthal") "\n\tPCyl Sph"; diff --git a/src/projections/lsat.cpp b/src/projections/lsat.cpp index 95bf1813..5b7520d3 100644 --- a/src/projections/lsat.cpp +++ b/src/projections/lsat.cpp @@ -5,7 +5,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(lsat, "Space oblique for LANDSAT") "\n\tCyl, Sph&Ell\n\tlsat= path="; diff --git a/src/projections/mbt_fps.cpp b/src/projections/mbt_fps.cpp index 6edc4103..beff3314 100644 --- a/src/projections/mbt_fps.cpp +++ b/src/projections/mbt_fps.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl, Sph"; diff --git a/src/projections/mbtfpp.cpp b/src/projections/mbtfpp.cpp index f65b4ee2..ebd860ee 100644 --- a/src/projections/mbtfpp.cpp +++ b/src/projections/mbtfpp.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic") "\n\tCyl, Sph"; diff --git a/src/projections/mbtfpq.cpp b/src/projections/mbtfpq.cpp index 0ead16d7..ec49f9ce 100644 --- a/src/projections/mbtfpq.cpp +++ b/src/projections/mbtfpq.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl, Sph"; diff --git a/src/projections/merc.cpp b/src/projections/merc.cpp index ba12fc8b..5b65de90 100644 --- a/src/projections/merc.cpp +++ b/src/projections/merc.cpp @@ -6,7 +6,7 @@ #include "proj_internal.h" #include "proj.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts="; PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Ell\n\t"; diff --git a/src/projections/mill.cpp b/src/projections/mill.cpp index 8171186a..5d4acd89 100644 --- a/src/projections/mill.cpp +++ b/src/projections/mill.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(mill, "Miller Cylindrical") "\n\tCyl, Sph"; diff --git a/src/projections/misrsom.cpp b/src/projections/misrsom.cpp index 7ba74843..c53f22a1 100644 --- a/src/projections/misrsom.cpp +++ b/src/projections/misrsom.cpp @@ -26,7 +26,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(misrsom, "Space oblique for MISR") "\n\tCyl, Sph&Ell\n\tpath="; diff --git a/src/projections/mod_ster.cpp b/src/projections/mod_ster.cpp index 6603ec60..83390178 100644 --- a/src/projections/mod_ster.cpp +++ b/src/projections/mod_ster.cpp @@ -2,7 +2,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(mil_os, "Miller Oblated Stereographic") "\n\tAzi(mod)"; diff --git a/src/projections/moll.cpp b/src/projections/moll.cpp index ec7df64d..03393b01 100644 --- a/src/projections/moll.cpp +++ b/src/projections/moll.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(moll, "Mollweide") "\n\tPCyl, Sph"; PROJ_HEAD(wag4, "Wagner IV") "\n\tPCyl, Sph"; diff --git a/src/projections/natearth.cpp b/src/projections/natearth.cpp index c1f1619c..d8e52c37 100644 --- a/src/projections/natearth.cpp +++ b/src/projections/natearth.cpp @@ -17,7 +17,7 @@ Port to PROJ.4 by Bernhard Jenny, 6 June 2011 #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(natearth, "Natural Earth") "\n\tPCyl, Sph"; diff --git a/src/projections/natearth2.cpp b/src/projections/natearth2.cpp index ca46fcfe..9849a723 100644 --- a/src/projections/natearth2.cpp +++ b/src/projections/natearth2.cpp @@ -10,7 +10,7 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016 #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(natearth2, "Natural Earth 2") "\n\tPCyl, Sph"; diff --git a/src/projections/nell.cpp b/src/projections/nell.cpp index aac11ef2..b6e69dd6 100644 --- a/src/projections/nell.cpp +++ b/src/projections/nell.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(nell, "Nell") "\n\tPCyl, Sph"; diff --git a/src/projections/nell_h.cpp b/src/projections/nell_h.cpp index db679dff..be28b917 100644 --- a/src/projections/nell_h.cpp +++ b/src/projections/nell_h.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl, Sph"; diff --git a/src/projections/nicol.cpp b/src/projections/nicol.cpp index 3805d33d..c4bee261 100644 --- a/src/projections/nicol.cpp +++ b/src/projections/nicol.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(nicol, "Nicolosi Globular") "\n\tMisc Sph, no inv"; diff --git a/src/projections/nsper.cpp b/src/projections/nsper.cpp index 0f646d00..a0bb5686 100644 --- a/src/projections/nsper.cpp +++ b/src/projections/nsper.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" namespace { // anonymous namespace diff --git a/src/projections/nzmg.cpp b/src/projections/nzmg.cpp index a5eb07e2..1c2d9fb7 100644 --- a/src/projections/nzmg.cpp +++ b/src/projections/nzmg.cpp @@ -30,7 +30,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(nzmg, "New Zealand Map Grid") "\n\tfixed Earth"; diff --git a/src/projections/ob_tran.cpp b/src/projections/ob_tran.cpp index 85f34f24..1726b622 100644 --- a/src/projections/ob_tran.cpp +++ b/src/projections/ob_tran.cpp @@ -5,7 +5,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/ocea.cpp b/src/projections/ocea.cpp index 23d0e164..75aa6666 100644 --- a/src/projections/ocea.cpp +++ b/src/projections/ocea.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area") "\n\tCyl, Sph" "lonc= alpha= or\n\tlat_1= lat_2= lon_1= lon_2="; diff --git a/src/projections/oea.cpp b/src/projections/oea.cpp index 78fa29be..f2fc1053 100644 --- a/src/projections/oea.cpp +++ b/src/projections/oea.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(oea, "Oblated Equal Area") "\n\tMisc Sph\n\tn= m= theta="; diff --git a/src/projections/omerc.cpp b/src/projections/omerc.cpp index 255c38ae..e9b7b4a0 100644 --- a/src/projections/omerc.cpp +++ b/src/projections/omerc.cpp @@ -27,7 +27,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(omerc, "Oblique Mercator") "\n\tCyl, Sph&Ell no_rot\n\t" diff --git a/src/projections/ortho.cpp b/src/projections/ortho.cpp index ef29e62e..d4300bd5 100644 --- a/src/projections/ortho.cpp +++ b/src/projections/ortho.cpp @@ -3,7 +3,7 @@ #include "proj.h" #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(ortho, "Orthographic") "\n\tAzi, Sph"; diff --git a/src/projections/patterson.cpp b/src/projections/patterson.cpp index 26abfba6..7f0ea3a9 100644 --- a/src/projections/patterson.cpp +++ b/src/projections/patterson.cpp @@ -43,7 +43,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(patterson, "Patterson Cylindrical") "\n\tCyl"; diff --git a/src/projections/poly.cpp b/src/projections/poly.cpp index 6a7ff513..b4b61b00 100644 --- a/src/projections/poly.cpp +++ b/src/projections/poly.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(poly, "Polyconic (American)") "\n\tConic, Sph&Ell"; diff --git a/src/projections/putp2.cpp b/src/projections/putp2.cpp index 006cb813..d5b3b9f5 100644 --- a/src/projections/putp2.cpp +++ b/src/projections/putp2.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl, Sph"; diff --git a/src/projections/putp3.cpp b/src/projections/putp3.cpp index ca356bd0..bc4a02e4 100644 --- a/src/projections/putp3.cpp +++ b/src/projections/putp3.cpp @@ -2,7 +2,7 @@ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/putp4p.cpp b/src/projections/putp4p.cpp index 5ec465d2..462dae81 100644 --- a/src/projections/putp4p.cpp +++ b/src/projections/putp4p.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/putp5.cpp b/src/projections/putp5.cpp index 2baa3914..62cb2ea9 100644 --- a/src/projections/putp5.cpp +++ b/src/projections/putp5.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/putp6.cpp b/src/projections/putp6.cpp index 134bbc8f..4bae7ae6 100644 --- a/src/projections/putp6.cpp +++ b/src/projections/putp6.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/qsc.cpp b/src/projections/qsc.cpp index ab287de8..409afb38 100644 --- a/src/projections/qsc.cpp +++ b/src/projections/qsc.cpp @@ -44,7 +44,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* The six cube faces. */ namespace { // anonymous namespace diff --git a/src/projections/robin.cpp b/src/projections/robin.cpp index d24cd7fa..8f142aad 100644 --- a/src/projections/robin.cpp +++ b/src/projections/robin.cpp @@ -2,7 +2,7 @@ #include "proj_math.h" #include "proj_internal.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(robin, "Robinson") "\n\tPCyl, Sph"; diff --git a/src/projections/rouss.cpp b/src/projections/rouss.cpp index 2ac31855..f58277b8 100644 --- a/src/projections/rouss.cpp +++ b/src/projections/rouss.cpp @@ -29,7 +29,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/rpoly.cpp b/src/projections/rpoly.cpp index e21e27ac..6e883ab2 100644 --- a/src/projections/rpoly.cpp +++ b/src/projections/rpoly.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/sch.cpp b/src/projections/sch.cpp index 418ebb5e..f4c66688 100644 --- a/src/projections/sch.cpp +++ b/src/projections/sch.cpp @@ -36,7 +36,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "geocent.h" namespace { // anonymous namespace diff --git a/src/projections/sconics.cpp b/src/projections/sconics.cpp index 4e796136..7bdd2603 100644 --- a/src/projections/sconics.cpp +++ b/src/projections/sconics.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" diff --git a/src/projections/somerc.cpp b/src/projections/somerc.cpp index 6c554e7f..ead9090f 100644 --- a/src/projections/somerc.cpp +++ b/src/projections/somerc.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(somerc, "Swiss. Obl. Mercator") "\n\tCyl, Ell\n\tFor CH1903"; diff --git a/src/projections/stere.cpp b/src/projections/stere.cpp index a26c27c2..9b24a596 100644 --- a/src/projections/stere.cpp +++ b/src/projections/stere.cpp @@ -1,7 +1,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" PROJ_HEAD(stere, "Stereographic") "\n\tAzi, Sph&Ell\n\tlat_ts="; diff --git a/src/projections/sterea.cpp b/src/projections/sterea.cpp index 60431a18..b6ebc7b4 100644 --- a/src/projections/sterea.cpp +++ b/src/projections/sterea.cpp @@ -26,7 +26,7 @@ #define PJ_LIB__ #include <errno.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "proj_math.h" diff --git a/src/projections/sts.cpp b/src/projections/sts.cpp index bdb1fd72..27dc3eb8 100644 --- a/src/projections/sts.cpp +++ b/src/projections/sts.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(kav5, "Kavraisky V") "\n\tPCyl, Sph"; PROJ_HEAD(qua_aut, "Quartic Authalic") "\n\tPCyl, Sph"; diff --git a/src/projections/tcc.cpp b/src/projections/tcc.cpp index ebe21015..cfac9974 100644 --- a/src/projections/tcc.cpp +++ b/src/projections/tcc.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(tcc, "Transverse Central Cylindrical") "\n\tCyl, Sph, no inv"; diff --git a/src/projections/tcea.cpp b/src/projections/tcea.cpp index 6c7b44f5..d780718d 100644 --- a/src/projections/tcea.cpp +++ b/src/projections/tcea.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph"; diff --git a/src/projections/times.cpp b/src/projections/times.cpp index a7ff1b93..4a0d0f59 100644 --- a/src/projections/times.cpp +++ b/src/projections/times.cpp @@ -34,7 +34,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(times, "Times") "\n\tCyl, Sph"; diff --git a/src/projections/tmerc.cpp b/src/projections/tmerc.cpp index 29d88d6e..d1938116 100644 --- a/src/projections/tmerc.cpp +++ b/src/projections/tmerc.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(tmerc, "Transverse Mercator") "\n\tCyl, Sph&Ell"; diff --git a/src/projections/tobmerc.cpp b/src/projections/tobmerc.cpp index 1889b484..95960097 100644 --- a/src/projections/tobmerc.cpp +++ b/src/projections/tobmerc.cpp @@ -6,7 +6,7 @@ #include "proj_internal.h" #include "proj.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(tobmerc, "Tobler-Mercator") "\n\tCyl, Sph"; diff --git a/src/projections/tpeqd.cpp b/src/projections/tpeqd.cpp index e25f8ed3..20921de4 100644 --- a/src/projections/tpeqd.cpp +++ b/src/projections/tpeqd.cpp @@ -2,7 +2,7 @@ #include <errno.h> #include "proj.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(tpeqd, "Two Point Equidistant") diff --git a/src/projections/urm5.cpp b/src/projections/urm5.cpp index 576eac76..a93293c0 100644 --- a/src/projections/urm5.cpp +++ b/src/projections/urm5.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl, Sph, no inv\n\tn= q= alpha="; diff --git a/src/projections/urmfps.cpp b/src/projections/urmfps.cpp index 2aa6432c..3a51798b 100644 --- a/src/projections/urmfps.cpp +++ b/src/projections/urmfps.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph\n\tn="; PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph"; diff --git a/src/projections/vandg.cpp b/src/projections/vandg.cpp index 91811b46..89620356 100644 --- a/src/projections/vandg.cpp +++ b/src/projections/vandg.cpp @@ -1,6 +1,6 @@ #define PJ_LIB__ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(vandg, "van der Grinten (I)") "\n\tMisc Sph"; diff --git a/src/projections/vandg2.cpp b/src/projections/vandg2.cpp index a1336029..de63b085 100644 --- a/src/projections/vandg2.cpp +++ b/src/projections/vandg2.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" namespace { // anonymous namespace struct pj_opaque { diff --git a/src/projections/vandg4.cpp b/src/projections/vandg4.cpp index 15171b75..8511431d 100644 --- a/src/projections/vandg4.cpp +++ b/src/projections/vandg4.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(vandg4, "van der Grinten IV") "\n\tMisc Sph, no inv"; diff --git a/src/projections/wag2.cpp b/src/projections/wag2.cpp index 3b62593a..e04cc648 100644 --- a/src/projections/wag2.cpp +++ b/src/projections/wag2.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl, Sph"; diff --git a/src/projections/wag3.cpp b/src/projections/wag3.cpp index c9d5470a..ed695ffd 100644 --- a/src/projections/wag3.cpp +++ b/src/projections/wag3.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl, Sph\n\tlat_ts="; diff --git a/src/projections/wag7.cpp b/src/projections/wag7.cpp index eada904b..45b70ee2 100644 --- a/src/projections/wag7.cpp +++ b/src/projections/wag7.cpp @@ -3,7 +3,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(wag7, "Wagner VII") "\n\tMisc Sph, no inv"; diff --git a/src/projections/wink1.cpp b/src/projections/wink1.cpp index 28eee9cf..75abbffc 100644 --- a/src/projections/wink1.cpp +++ b/src/projections/wink1.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(wink1, "Winkel I") "\n\tPCyl, Sph\n\tlat_ts="; diff --git a/src/projections/wink2.cpp b/src/projections/wink2.cpp index 9e7ec411..6957bde1 100644 --- a/src/projections/wink2.cpp +++ b/src/projections/wink2.cpp @@ -4,7 +4,7 @@ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl, Sph, no inv\n\tlat_1="; diff --git a/src/projects.h b/src/projects.h deleted file mode 100644 index 81b27875..00000000 --- a/src/projects.h +++ /dev/null @@ -1,829 +0,0 @@ -/****************************************************************************** - * Project: PROJ.4 - * Purpose: Primary (private) include file for PROJ.4 library. - * Author: Gerald Evenden - * - ****************************************************************************** - * Copyright (c) 2000, Frank Warmerdam - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - *****************************************************************************/ - -/* General projections header file */ -#ifndef PROJECTS_H -#define PROJECTS_H - -#ifndef __cplusplus -#error "projects.h can only be included from a C++ file" -#endif - -#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H -#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H -#endif - -#ifdef _MSC_VER -# ifndef _CRT_SECURE_NO_DEPRECATE -# define _CRT_SECURE_NO_DEPRECATE -# endif -# ifndef _CRT_NONSTDC_NO_DEPRECATE -# define _CRT_NONSTDC_NO_DEPRECATE -# endif -/* enable predefined math constants M_* for MS Visual Studio workaround */ -# ifndef _USE_MATH_DEFINES -# define _USE_MATH_DEFINES -# endif -#endif - -#ifdef PROJ_RENAME_SYMBOLS -#include "proj_symbol_rename.h" -#endif - -/* standard inclusions */ -#include <limits.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "proj/common.hpp" -#include "proj/coordinateoperation.hpp" -#include <string> -#include <vector> - -#ifndef PROJ_DLL -#ifdef PROJ_MSVC_DLL_EXPORT -#define PROJ_DLL __declspec(dllexport) -#elif defined(PROJ_MSVC_DLL_IMPORT) -#define PROJ_DLL __declspec(dllimport) -#elif defined(__GNUC__) -#define PROJ_DLL __attribute__ ((visibility("default"))) -#else -#define PROJ_DLL -#endif -#endif - -#define C_NAMESPACE extern "C" -#define C_NAMESPACE_VAR extern "C" - -#ifndef NULL -# define NULL 0 -#endif - -#ifndef FALSE -# define FALSE 0 -#endif - -#ifndef TRUE -# define TRUE 1 -#endif - -#ifndef MAX -# define MIN(a,b) ((a<b) ? a : b) -# define MAX(a,b) ((a>b) ? a : b) -#endif - -#ifndef ABS -# define ABS(x) ((x<0) ? (-1*(x)) : x) -#endif - -#if INT_MAX == 2147483647 -typedef int pj_int32; -#elif LONG_MAX == 2147483647 -typedef long pj_int32; -#else -#warning It seems no 32-bit integer type is available -#endif - -/* maximum path/filename */ -#ifndef MAX_PATH_FILENAME -#define MAX_PATH_FILENAME 1024 -#endif - -/* If we still haven't got M_PI*, we rely on our own defines. - * For example, this is necessary when compiling with gcc and - * the -ansi flag. - */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#define M_PI_2 1.57079632679489661923 -#define M_PI_4 0.78539816339744830962 -#define M_2_PI 0.63661977236758134308 -#endif - -/* M_SQRT2 might be missing */ -#ifndef M_SQRT2 -#define M_SQRT2 1.41421356237309504880 -#endif - -/* some more useful math constants and aliases */ -#define M_FORTPI M_PI_4 /* pi/4 */ -#define M_HALFPI M_PI_2 /* pi/2 */ -#define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */ -#define M_TWOPI 6.28318530717958647693 /* 2*pi */ -#define M_TWO_D_PI M_2_PI /* 2/pi */ -#define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */ - - -/* maximum tag id length for +init and default files */ -#ifndef ID_TAG_MAX -#define ID_TAG_MAX 50 -#endif - -/* Use WIN32 as a standard windows 32 bit declaration */ -#if defined(_WIN32) && !defined(WIN32) -# define WIN32 -#endif - -#if defined(_WINDOWS) && !defined(WIN32) -# define WIN32 -#endif - -/* directory delimiter for DOS support */ -#ifdef WIN32 -#define DIR_CHAR '\\' -#else -#define DIR_CHAR '/' -#endif - -typedef struct { double r, i; } COMPLEX; - -/* Forward declarations and typedefs for stuff needed inside the PJ object */ -struct PJconsts; - -union PJ_COORD; -struct geod_geodesic; -struct ARG_list; -struct PJ_REGION_S; -typedef struct PJ_REGION_S PJ_Region; -typedef struct ARG_list paralist; /* parameter list */ -#ifndef PROJ_INTERNAL_H -enum pj_io_units { - PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */ - PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */ - PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */ - PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */ - PJ_IO_UNITS_ANGULAR = 4 /* Radians */ -}; -#endif -#ifndef PROJ_H -typedef struct PJconsts PJ; /* the PJ object herself */ -typedef union PJ_COORD PJ_COORD; -#endif - -struct PJ_REGION_S { - double ll_long; /* lower left corner coordinates (radians) */ - double ll_lat; - double ur_long; /* upper right corner coordinates (radians) */ - double ur_lat; -}; - -struct PJ_AREA { - int bbox_set; - double west_lon_degree; - double south_lat_degree; - double east_lon_degree; - double north_lat_degree; -}; - -struct projCtx_t; -typedef struct projCtx_t projCtx_t; - -/***************************************************************************** - - Some function types that are especially useful when working with PJs - -****************************************************************************** - -PJ_CONSTRUCTOR: - - A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ. - Historically called twice: First with a 0 argument, to allocate memory, - second with the first return value as argument, for actual setup. - -PJ_DESTRUCTOR: - - A function taking a pointer-to-PJ and an integer as args, then first - handling the deallocation of the PJ, afterwards handing the integer over - to the error reporting subsystem, and finally returning a null pointer in - support of the "return free (P)" (aka "get the hell out of here") idiom. - -PJ_OPERATOR: - - A function taking a PJ_COORD and a pointer-to-PJ as args, applying the - PJ to the PJ_COORD, and returning the resulting PJ_COORD. - -*****************************************************************************/ -typedef PJ *(* PJ_CONSTRUCTOR) (PJ *); -typedef PJ *(* PJ_DESTRUCTOR) (PJ *, int); -typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *); -/****************************************************************************/ - - -/* datum_type values */ -#define PJD_UNKNOWN 0 -#define PJD_3PARAM 1 -#define PJD_7PARAM 2 -#define PJD_GRIDSHIFT 3 -#define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */ - - -/* base projection data structure */ -struct PJconsts { - - /************************************************************************************* - - G E N E R A L P A R A M E T E R S T R U C T - - ************************************************************************************** - - TODO: Need some description here - especially about the thread context... - This is the struct behind the PJ typedef - - **************************************************************************************/ - - projCtx_t *ctx = nullptr; - const char *descr = nullptr; /* From pj_list.h or individual PJ_*.c file */ - paralist *params = nullptr; /* Parameter list */ - char *def_full = nullptr; /* Full textual definition (usually 0 - set by proj_pj_info) */ - char *def_size = nullptr; /* Shape and size parameters extracted from params */ - char *def_shape = nullptr; - char *def_spherification = nullptr; - char *def_ellps = nullptr; - - struct geod_geodesic *geod = nullptr; /* For geodesic computations */ - void *opaque = nullptr; /* Projection specific parameters, Defined in PJ_*.c */ - int inverted = 0; /* Tell high level API functions to swap inv/fwd */ - - - /************************************************************************************* - - F U N C T I O N P O I N T E R S - - ************************************************************************************** - - For projection xxx, these are pointers to functions in the corresponding - PJ_xxx.c file. - - pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(), - a name which is currently hidden behind the magic curtain of the PROJECTION - macro. - - **************************************************************************************/ - - - 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; - - PJ_DESTRUCTOR destructor = nullptr; - - - /************************************************************************************* - - E L L I P S O I D P A R A M E T E R S - - ************************************************************************************** - - Despite YAGNI, we add a large number of ellipsoidal shape parameters, which - are not yet set up in pj_init. They are, however, inexpensive to compute, - compared to the overall time taken for setting up the complex PJ object - (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity). - - But during single point projections it will often be a useful thing to have - these readily available without having to recompute at every pj_fwd / pj_inv - call. - - With this wide selection, we should be ready for quite a number of geodetic - algorithms, without having to incur further ABI breakage. - - **************************************************************************************/ - - /* The linear parameters */ - - double a = 0.0; /* semimajor axis (radius if eccentricity==0) */ - double b = 0.0; /* semiminor axis */ - double ra = 0.0; /* 1/a */ - double rb = 0.0; /* 1/b */ - - /* The eccentricities */ - - double alpha = 0.0; /* angular eccentricity */ - double e = 0.0; /* first eccentricity */ - double es = 0.0; /* first eccentricity squared */ - double e2 = 0.0; /* second eccentricity */ - double e2s = 0.0; /* second eccentricity squared */ - double e3 = 0.0; /* third eccentricity */ - double e3s = 0.0; /* third eccentricity squared */ - double one_es = 0.0; /* 1 - e^2 */ - double rone_es = 0.0; /* 1/one_es */ - - - /* The flattenings */ - double f = 0.0; /* first flattening */ - double f2 = 0.0; /* second flattening */ - double n = 0.0; /* third flattening */ - double rf = 0.0; /* 1/f */ - double rf2 = 0.0; /* 1/f2 */ - double rn = 0.0; /* 1/n */ - - /* This one's for GRS80 */ - double J = 0.0; /* "Dynamic form factor" */ - - double es_orig = 0.0; /* es and a before any +proj related adjustment */ - double a_orig = 0.0; - - - /************************************************************************************* - - C O O R D I N A T E H A N D L I N G - - **************************************************************************************/ - - int over = 0; /* Over-range flag */ - int geoc = 0; /* Geocentric latitude flag */ - int is_latlong = 0; /* proj=latlong ... not really a projection at all */ - int is_geocent = 0; /* proj=geocent ... not really a projection at all */ - int is_pipeline = 0; /* 1 if PJ represents a pipeline */ - int need_ellps = 0; /* 0 for operations that are purely cartesian */ - int skip_fwd_prepare = 0; - int skip_fwd_finalize = 0; - int skip_inv_prepare = 0; - int skip_inv_finalize = 0; - - enum pj_io_units left = PJ_IO_UNITS_WHATEVER; /* Flags for input/output coordinate types */ - enum pj_io_units right = PJ_IO_UNITS_WHATEVER; - - /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */ - PJ *axisswap = nullptr; - PJ *cart = nullptr; - PJ *cart_wgs84 = nullptr; - PJ *helmert = nullptr; - PJ *hgridshift = nullptr; - PJ *vgridshift = nullptr; - - - /************************************************************************************* - - C A R T O G R A P H I C O F F S E T S - - **************************************************************************************/ - - double lam0 = 0.0; /* central meridian */ - double phi0 = 0.0; /* central parallel */ - double x0 = 0.0; /* false easting */ - double y0 = 0.0; /* false northing */ - double z0 = 0.0; /* height origin */ - double t0 = 0.0; /* time origin */ - - - /************************************************************************************* - - S C A L I N G - - **************************************************************************************/ - - double k0 = 0.0; /* General scaling factor - e.g. the 0.9996 of UTM */ - double to_meter = 0.0, fr_meter = 0.0; /* Plane coordinate scaling. Internal unit [m] */ - double vto_meter = 0.0, vfr_meter = 0.0; /* Vertical scaling. Internal unit [m] */ - - - /************************************************************************************* - - D A T U M S A N D H E I G H T S Y S T E M S - - ************************************************************************************** - - It may be possible, and meaningful, to move the list parts of this up to the - PJ_CONTEXT level. - - **************************************************************************************/ - - int datum_type = PJD_UNKNOWN; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ - double datum_params[7] = {0,0,0,0,0,0,0}; /* Parameters for 3PARAM and 7PARAM */ - struct _pj_gi **gridlist = nullptr; /* TODO: Description needed */ - int gridlist_count = 0; - - int has_geoid_vgrids = 0; /* TODO: Description needed */ - struct _pj_gi **vgridlist_geoid = nullptr; /* TODO: Description needed */ - int vgridlist_geoid_count = 0; - - double from_greenwich = 0.0; /* prime meridian offset (in radians) */ - double long_wrap_center = 0.0; /* 0.0 for -180 to 180, actually in radians*/ - int is_long_wrap_set = 0; - char axis[4] = {0,0,0,0}; /* Axis order, pj_transform/pj_adjust_axis */ - - /* New Datum Shift Grid Catalogs */ - char *catalog_name = nullptr; - struct _PJ_GridCatalog *catalog = nullptr; - - double datum_date = 0.0; /* TODO: Description needed */ - - struct _pj_gi *last_before_grid = nullptr; /* TODO: Description needed */ - PJ_Region last_before_region = {0,0,0,0}; /* TODO: Description needed */ - double last_before_date = 0.0; /* TODO: Description needed */ - - struct _pj_gi *last_after_grid = nullptr; /* TODO: Description needed */ - PJ_Region last_after_region = {0,0,0,0}; /* TODO: Description needed */ - double last_after_date = 0.0; /* TODO: Description needed */ - - /************************************************************************************* - ISO-19111 interface - **************************************************************************************/ - - NS_PROJ::common::IdentifiedObjectPtr iso_obj{}; - - // cached results - mutable std::string lastWKT{}; - mutable std::string lastPROJString{}; - mutable bool gridsNeededAsked = false; - mutable std::vector<NS_PROJ::operation::GridDescription> gridsNeeded{}; - - /************************************************************************************* - - E N D O F G E N E R A L P A R A M E T E R S T R U C T - - **************************************************************************************/ - - PJconsts(); - PJconsts(const PJconsts &) = delete; - PJconsts &operator=(const PJconsts &) = delete; -}; - - - - -/* Parameter list (a copy of the +proj=... etc. parameters) */ -struct ARG_list { - paralist *next; - char used; -#if defined(__GNUC__) && __GNUC__ >= 8 - char param[]; /* variable-length member */ - /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */ - /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */ -#else - char param[1]; /* variable-length member */ -#endif -}; - - -typedef union { double f; int i; char *s; } PROJVALUE; - - -struct PJ_DATUMS { - const char *id; /* datum keyword */ - const char *defn; /* ie. "to_wgs84=..." */ - const char *ellipse_id; /* ie from ellipse table */ - const char *comments; /* EPSG code, etc */ -}; - - -struct DERIVS { - double x_l, x_p; /* derivatives of x for lambda-phi */ - double y_l, y_p; /* derivatives of y for lambda-phi */ -}; - -struct FACTORS { - struct DERIVS der; - double h, k; /* meridional, parallel scales */ - double omega, thetap; /* angular distortion, theta prime */ - double conv; /* convergence */ - double s; /* areal scale factor */ - double a, b; /* max-min scale error */ - int code; /* always 0 */ -}; - -/* library errors */ -#define PJD_ERR_NO_ARGS -1 -#define PJD_ERR_NO_OPTION_IN_INIT_FILE -2 -#define PJD_ERR_NO_COLON_IN_INIT_STRING -3 -#define PJD_ERR_PROJ_NOT_NAMED -4 -#define PJD_ERR_UNKNOWN_PROJECTION_ID -5 -#define PJD_ERR_ECCENTRICITY_IS_ONE -6 -#define PJD_ERR_UNKNOWN_UNIT_ID -7 -#define PJD_ERR_INVALID_BOOLEAN_PARAM -8 -#define PJD_ERR_UNKNOWN_ELLP_PARAM -9 -#define PJD_ERR_REV_FLATTENING_IS_ZERO -10 -#define PJD_ERR_REF_RAD_LARGER_THAN_90 -11 -#define PJD_ERR_ES_LESS_THAN_ZERO -12 -#define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13 -#define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14 -#define PJD_ERR_INVALID_X_OR_Y -15 -#define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16 -#define PJD_ERR_NON_CONV_INV_MERI_DIST -17 -#define PJD_ERR_NON_CON_INV_PHI2 -18 -#define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19 -#define PJD_ERR_TOLERANCE_CONDITION -20 -#define PJD_ERR_CONIC_LAT_EQUAL -21 -#define PJD_ERR_LAT_LARGER_THAN_90 -22 -#define PJD_ERR_LAT1_IS_ZERO -23 -#define PJD_ERR_LAT_TS_LARGER_THAN_90 -24 -#define PJD_ERR_CONTROL_POINT_NO_DIST -25 -#define PJD_ERR_NO_ROTATION_PROJ -26 -#define PJD_ERR_W_OR_M_ZERO_OR_LESS -27 -#define PJD_ERR_LSAT_NOT_IN_RANGE -28 -#define PJD_ERR_PATH_NOT_IN_RANGE -29 -#define PJD_ERR_H_LESS_THAN_ZERO -30 -#define PJD_ERR_K_LESS_THAN_ZERO -31 -#define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32 -#define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33 -#define PJD_ERR_ELLIPSOID_USE_REQUIRED -34 -#define PJD_ERR_INVALID_UTM_ZONE -35 -#define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36 -#define PJD_ERR_FAILED_TO_FIND_PROJ -37 -#define PJD_ERR_FAILED_TO_LOAD_GRID -38 -#define PJD_ERR_INVALID_M_OR_N -39 -#define PJD_ERR_N_OUT_OF_RANGE -40 -#define PJD_ERR_LAT_1_2_UNSPECIFIED -41 -#define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42 -#define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43 -#define PJD_ERR_UNPARSEABLE_CS_DEF -44 -#define PJD_ERR_GEOCENTRIC -45 -#define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46 -#define PJD_ERR_AXIS -47 -#define PJD_ERR_GRID_AREA -48 -#define PJD_ERR_INVALID_SWEEP_AXIS -49 -#define PJD_ERR_MALFORMED_PIPELINE -50 -#define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51 -#define PJD_ERR_INVALID_SCALE -52 -#define PJD_ERR_NON_CONVERGENT -53 -#define PJD_ERR_MISSING_ARGS -54 -#define PJD_ERR_LAT_0_IS_ZERO -55 -#define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56 -#define PJD_ERR_TOO_MANY_INITS -57 -#define PJD_ERR_INVALID_ARG -58 -#define PJD_ERR_INCONSISTENT_UNIT -59 -/* NOTE: Remember to update pj_strerrno.c and transient_error in */ -/* pj_transform.c when adding new value */ - -struct projFileAPI_t; - -struct projCppContext; - -/* proj thread context */ -struct projCtx_t { - int last_errno; - int debug_level; - void (*logger)(void *, int, const char *); - void *app_data; - struct projFileAPI_t *fileapi; - struct projCppContext* cpp_context; /* internal context for C++ code */ - int use_proj4_init_rules; /* -1 = unknown, 0 = no, 1 = yes */ - int epsg_file_exists; /* -1 = unknown, 0 = no, 1 = yes */ -}; - -/* classic public API */ -#include "proj_api.h" - - -/* Generate pj_list external or make list from include file */ -#ifndef PJ_DATUMS__ -C_NAMESPACE_VAR struct PJ_DATUMS pj_datums[]; -#endif - - - - - -#ifdef PJ_LIB__ -#define PROJ_HEAD(name, desc) static const char des_##name [] = desc - -#define OPERATION(name, NEED_ELPJ_LPS) \ - \ -pj_projection_specific_setup_##name (PJ *P); \ -C_NAMESPACE PJ *pj_##name (PJ *P); \ - \ -C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \ - \ -C_NAMESPACE PJ *pj_##name (PJ *P) { \ - if (P) \ - return pj_projection_specific_setup_##name (P); \ - P = pj_new(); \ - if (nullptr==P) \ - return nullptr; \ - P->descr = des_##name; \ - P->need_ellps = NEED_ELPJ_LPS; \ - P->left = PJ_IO_UNITS_ANGULAR; \ - P->right = PJ_IO_UNITS_CLASSIC; \ - return P; \ -} \ - \ -PJ *pj_projection_specific_setup_##name (PJ *P) - -/* In ISO19000 lingo, an operation is either a conversion or a transformation */ -#define CONVERSION(name, need_ellps) OPERATION (name, need_ellps) -#define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps) - -/* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */ -#define PROJECTION(name) CONVERSION (name, 1) - -#endif /* def PJ_LIB__ */ - - -#define MAX_TAB_ID 80 -typedef struct { float lam, phi; } FLP; -typedef struct { pj_int32 lam, phi; } ILP; - -struct CTABLE { - char id[MAX_TAB_ID]; /* ascii info */ - PJ_LP ll; /* lower left corner coordinates */ - PJ_LP del; /* size of cells */ - ILP lim; /* limits of conversion matrix */ - FLP *cvs; /* conversion matrix */ -}; - -typedef struct _pj_gi { - char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */ - char *filename; /* full path to filename */ - - const char *format; /* format of this grid, ie "ctable", "ntv1", - "ntv2" or "missing". */ - - long grid_offset; /* offset in file, for delayed loading */ - int must_swap; /* only for NTv2 */ - - struct CTABLE *ct; - - struct _pj_gi *next; - struct _pj_gi *child; -} PJ_GRIDINFO; - -typedef struct { - PJ_Region region; - int priority; /* higher used before lower */ - double date; /* year.fraction */ - char *definition; /* usually the gridname */ - - PJ_GRIDINFO *gridinfo; - int available; /* 0=unknown, 1=true, -1=false */ -} PJ_GridCatalogEntry; - -typedef struct _PJ_GridCatalog { - char *catalog_name; - - PJ_Region region; /* maximum extent of catalog data */ - - int entry_count; - PJ_GridCatalogEntry *entries; - - struct _PJ_GridCatalog *next; -} PJ_GridCatalog; - -/* procedure prototypes */ -double PROJ_DLL dmstor(const char *, char **); -double dmstor_ctx(projCtx ctx, const char *, char **); -void PROJ_DLL set_rtodms(int, int); -char PROJ_DLL *rtodms(char *, double, int, int); -double PROJ_DLL adjlon(double); -double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double); - -PROJVALUE PROJ_DLL pj_param(projCtx ctx, paralist *, const char *); -paralist PROJ_DLL *pj_param_exists (paralist *list, const char *parameter); -paralist PROJ_DLL *pj_mkparam(const char *); -paralist *pj_mkparam_ws (const char *str); - - -int PROJ_DLL pj_ell_set(projCtx ctx, paralist *, double *, double *); -int pj_datum_set(projCtx,paralist *, PJ *); -int pj_angular_units_set(paralist *, PJ *); - -paralist *pj_clone_paralist( const paralist* ); -paralist *pj_search_initcache( const char *filekey ); -void pj_insert_initcache( const char *filekey, const paralist *list); -paralist *pj_expand_init(projCtx ctx, paralist *init); - -void *pj_dealloc_params (projCtx ctx, paralist *start, int errlev); - - -double *pj_enfn(double); -double pj_mlfn(double, double, double, double *); -double pj_inv_mlfn(projCtx, double, double, double *); -double pj_qsfn(double, double, double); -double pj_tsfn(double, double, double); -double pj_msfn(double, double, double); -double PROJ_DLL pj_phi2(projCtx, double, double); -double pj_qsfn_(double, PJ *); -double *pj_authset(double); -double pj_authlat(double, double *); - -COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int); -COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *); - -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) */ - double *c; /* power coefficients */ -}; - -/* Approximation structures and procedures */ -typedef struct { /* Chebyshev or Power series structure */ - 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(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(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 */ -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 ); -struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid ); -int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid ); -void nad_free(struct CTABLE *); - -/* higher level handling of datum grid shift files */ - -int pj_apply_vgridshift( PJ *defn, const char *listname, - PJ_GRIDINFO ***gridlist_p, - int *gridlist_count_p, - int inverse, - long point_count, int point_offset, - double *x, double *y, double *z ); -int pj_apply_gridshift_2( PJ *defn, int inverse, - long point_count, int point_offset, - double *x, double *y, double *z ); -int pj_apply_gridshift_3( projCtx ctx, - PJ_GRIDINFO **gridlist, int gridlist_count, - int inverse, long point_count, int point_offset, - double *x, double *y, double *z ); - -PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * ); -void PROJ_DLL pj_deallocate_grids(); - -PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * ); -int pj_gridinfo_load( projCtx, PJ_GRIDINFO * ); -void pj_gridinfo_free( projCtx, PJ_GRIDINFO * ); - -PJ_GridCatalog *pj_gc_findcatalog( projCtx, const char * ); -PJ_GridCatalog *pj_gc_readcatalog( projCtx, const char * ); -void pj_gc_unloadall( projCtx ); -int pj_gc_apply_gridshift( PJ *defn, int inverse, - long point_count, int point_offset, - double *x, double *y, double *z ); -int pj_gc_apply_gridshift( PJ *defn, int inverse, - long point_count, int point_offset, - double *x, double *y, double *z ); - -PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, - PJ_GridCatalog *catalog, int after, - PJ_LP location, double date, - PJ_Region *optional_region, - double *grid_date ); - -double pj_gc_parsedate( projCtx, const char * ); - -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 *); -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 ); - -PJ *pj_new(void); -PJ *pj_default_destructor (PJ *P, int errlev); - -double PROJ_DLL pj_atof( const char* nptr ); -double pj_strtod( const char *nptr, char **endptr ); -void pj_freeup_plain (PJ *P); - -projPJ pj_init_ctx_with_allow_init_epsg( projCtx ctx, int argc, char **argv, int allow_init_epsg ); - -#ifndef PROJECTS_H_ATEND -#define PROJECTS_H_ATEND -#endif -#endif /* end of basic projections header */ diff --git a/src/qsfn.cpp b/src/qsfn.cpp index c8592d3d..35ba3b93 100644 --- a/src/qsfn.cpp +++ b/src/qsfn.cpp @@ -1,7 +1,7 @@ /* determine small q */ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" # define EPSILON 1.0e-7 diff --git a/src/release.cpp b/src/release.cpp index 9beb45ef..ddc768c6 100644 --- a/src/release.cpp +++ b/src/release.cpp @@ -1,7 +1,7 @@ /* <<< Release Notice for library >>> */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #define STR_HELPER(x) #x #define STR(x) STR_HELPER(x) diff --git a/src/rtodms.cpp b/src/rtodms.cpp index d7686931..9b3b7cb9 100644 --- a/src/rtodms.cpp +++ b/src/rtodms.cpp @@ -6,7 +6,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* ** RES is fractional second figures diff --git a/src/strerrno.cpp b/src/strerrno.cpp index 18ed0d33..9f690041 100644 --- a/src/strerrno.cpp +++ b/src/strerrno.cpp @@ -5,7 +5,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" static const char * const pj_err_list[] = { diff --git a/src/strtod.cpp b/src/strtod.cpp index ccf26321..7ab271c5 100644 --- a/src/strtod.cpp +++ b/src/strtod.cpp @@ -33,7 +33,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* Windows nmake build doesn't have a proj_config.h, but HAVE_LOCALECONV */ /* is defined in the compilation line */ diff --git a/src/transform.cpp b/src/transform.cpp index 2c8dc467..486178d0 100644 --- a/src/transform.cpp +++ b/src/transform.cpp @@ -32,7 +32,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include "geocent.h" static int adjust_axis( projCtx ctx, const char *axis, int denormalize_flag, diff --git a/src/transformations/affine.cpp b/src/transformations/affine.cpp index 002bb2dd..21529a20 100644 --- a/src/transformations/affine.cpp +++ b/src/transformations/affine.cpp @@ -27,7 +27,7 @@ #include "proj_internal.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(affine, "Affine transformation"); PROJ_HEAD(geogoffset, "Geographic Offset"); diff --git a/src/transformations/deformation.cpp b/src/transformations/deformation.cpp index 7efe8a8c..9221d39e 100644 --- a/src/transformations/deformation.cpp +++ b/src/transformations/deformation.cpp @@ -56,7 +56,7 @@ grid-values in units of mm/year in ENU-space. #include "proj.h" #include "proj_internal.h" #include "proj_math.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(deformation, "Kinematic grid shift"); diff --git a/src/transformations/helmert.cpp b/src/transformations/helmert.cpp index 55112aaa..085bbbf9 100644 --- a/src/transformations/helmert.cpp +++ b/src/transformations/helmert.cpp @@ -53,7 +53,7 @@ Last update: 2018-10-26 #include <math.h> #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" #include "geocent.h" PROJ_HEAD(helmert, "3(6)-, 4(8)- and 7(14)-parameter Helmert shift"); diff --git a/src/transformations/hgridshift.cpp b/src/transformations/hgridshift.cpp index c8dfea15..788c2ebb 100644 --- a/src/transformations/hgridshift.cpp +++ b/src/transformations/hgridshift.cpp @@ -6,7 +6,7 @@ #include <time.h> #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(hgridshift, "Horizontal grid shift"); diff --git a/src/transformations/horner.cpp b/src/transformations/horner.cpp index 271d1187..f5d749c4 100644 --- a/src/transformations/horner.cpp +++ b/src/transformations/horner.cpp @@ -85,7 +85,7 @@ #include "proj.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(horner, "Horner polynomial evaluation"); diff --git a/src/transformations/molodensky.cpp b/src/transformations/molodensky.cpp index 843da5c9..002c5286 100644 --- a/src/transformations/molodensky.cpp +++ b/src/transformations/molodensky.cpp @@ -49,7 +49,7 @@ #include "proj.h" #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(molodensky, "Molodensky transform"); diff --git a/src/transformations/vgridshift.cpp b/src/transformations/vgridshift.cpp index fe2bc3e5..95537cda 100644 --- a/src/transformations/vgridshift.cpp +++ b/src/transformations/vgridshift.cpp @@ -6,7 +6,7 @@ #include <time.h> #include "proj_internal.h" -#include "projects.h" +#include "proj_internal.h" PROJ_HEAD(vgridshift, "Vertical grid shift"); diff --git a/src/tsfn.cpp b/src/tsfn.cpp index fb299dc9..32da09f2 100644 --- a/src/tsfn.cpp +++ b/src/tsfn.cpp @@ -1,7 +1,7 @@ /* determine small t */ #include <math.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" double pj_tsfn(double phi, double sinphi, double e) { double denominator; diff --git a/src/units.cpp b/src/units.cpp index 50f11396..34a71db1 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -5,7 +5,7 @@ #include "proj.h" #define PJ_UNITS__ -#include "projects.h" +#include "proj_internal.h" /* Field 2 that contains the multiplier to convert named units to meters ** may be expressed by either a simple floating point constant or a diff --git a/src/utils.cpp b/src/utils.cpp index 9a320fa4..9cb13f44 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -32,7 +32,7 @@ #include <string.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /************************************************************************/ /* pj_is_latlong() */ diff --git a/src/vector1.cpp b/src/vector1.cpp index 31a425a8..fc69f5c3 100644 --- a/src/vector1.cpp +++ b/src/vector1.cpp @@ -1,7 +1,7 @@ /* make storage for one and two dimensional matricies */ #include <stdlib.h> #include "proj.h" -#include "projects.h" +#include "proj_internal.h" void * /* one dimension array */ vector1(int nvals, int size) { return((void *)pj_malloc(size * nvals)); } void /* free 2D array */ diff --git a/src/zpoly1.cpp b/src/zpoly1.cpp index 5aded697..c7b7a3e3 100644 --- a/src/zpoly1.cpp +++ b/src/zpoly1.cpp @@ -1,6 +1,6 @@ /* evaluate complex polynomial */ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" /* note: coefficients are always from C_1 to C_n ** i.e. C_0 == (0., 0) ** n should always be >= 1 though no checks are made diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp index 9ff7a278..1b5ce83b 100644 --- a/test/unit/gie_self_tests.cpp +++ b/test/unit/gie_self_tests.cpp @@ -31,9 +31,8 @@ // PROJ include order is sensitive // clang-format off -#include "proj_internal.h" #include "proj.h" -#include "projects.h" +#include "proj_internal.h" // clang-format on #include <cmath> diff --git a/test/unit/pj_phi2_test.cpp b/test/unit/pj_phi2_test.cpp index fcfa1e30..5fc84600 100644 --- a/test/unit/pj_phi2_test.cpp +++ b/test/unit/pj_phi2_test.cpp @@ -27,7 +27,7 @@ ****************************************************************************/ #include "proj.h" -#include "projects.h" +#include "proj_internal.h" #include <cmath> #include <limits> diff --git a/test/unit/pj_transform_test.cpp b/test/unit/pj_transform_test.cpp index eb6a7f9d..ea9706dd 100644 --- a/test/unit/pj_transform_test.cpp +++ b/test/unit/pj_transform_test.cpp @@ -34,7 +34,7 @@ // PROJ include order is sensitive // clang-format off #include <proj.h> -#include <projects.h> +#include "proj_internal.h" #include <proj_api.h> // clang-format on |
