From 5f1522ad7652e562f98328b05d905c407bab99e9 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Mon, 20 Nov 2017 13:20:02 +0100 Subject: Replace pj_ell_set with reimplementation... (#675) * Replace pj_ell_set with reimplementation supporting ellipsoid inheritance * remove unreachable code from pj_ell_set.c * Swap steps, so ellps args are read first, in accordance with historical behaviour * Add ellipsoid tests to CI targets * Reduce some optimistic tolerances OS/X appears to have a slightly off float handling, resulting in differences at the nanometer level. Switching to 10 nm. --- src/projects.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/projects.h') diff --git a/src/projects.h b/src/projects.h index 32b74b08..f8f1fa38 100644 --- a/src/projects.h +++ b/src/projects.h @@ -229,6 +229,11 @@ struct PJconsts { projCtx_t *ctx; const char *descr; /* From pj_list.h or individual PJ_*.c file */ paralist *params; /* Parameter list */ + char *def_size; /* Shape and size parameters extracted from params */ + char *def_shape; + char *def_spherification; + char *def_ellps; + struct geod_geodesic *geod; /* For geodesic computations */ struct pj_opaque *opaque; /* Projection specific parameters, Defined in PJ_*.c */ int inverted; /* Tell high level API functions to swap inv/fwd */ @@ -413,11 +418,6 @@ struct ARG_list { typedef union { double f; int i; char *s; } PROJVALUE; -struct PJ_SELFTEST_LIST { - char *id; /* projection keyword */ - int (* testfunc)(void); /* projection entry point */ -}; - struct PJ_ELLPS { char *id; /* ellipse keyword name */ char *major; /* a= value */ @@ -534,6 +534,7 @@ enum deprecated_constants_for_now_dropped_analytical_factors { #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 struct projFileAPI_t; @@ -676,6 +677,7 @@ double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(doubl PROJVALUE pj_param(projCtx ctx, paralist *, const char *); paralist *pj_mkparam(char *); +int pj_ellipsoid (PJ *); int pj_ell_set(projCtx ctx, paralist *, double *, double *); int pj_datum_set(projCtx,paralist *, PJ *); int pj_prime_meridian_set(paralist *, PJ *); -- cgit v1.2.3 From 55335038504a298a51a0da8cca380cb247695378 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Wed, 22 Nov 2017 09:39:54 +0100 Subject: Avoid div-by-zero in rf setup --- src/projects.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/projects.h') diff --git a/src/projects.h b/src/projects.h index f8f1fa38..91c0e6a3 100644 --- a/src/projects.h +++ b/src/projects.h @@ -479,14 +479,14 @@ enum deprecated_constants_for_now_dropped_analytical_factors { /* library errors */ #define PJD_ERR_NO_ARGS -1 #define PJD_ERR_NO_OPTION_IN_INIT_FILE -2 -#define PJD_ERR_NO_COLOR_IN_INIT_STRING -3 +#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_UNKNOW_UNIT_ID -7 #define PJD_ERR_INVALID_BOOLEAN_PARAM -8 #define PJD_ERR_UNKNOWN_ELLP_PARAM -9 -#define PJD_ERR_REC_FLATTENING_IS_ZERO -10 +#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 -- cgit v1.2.3 From a2a546a74acf16cf0721ce3572534f06c2822b11 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Sat, 25 Nov 2017 06:23:42 +0100 Subject: Improve API (#683) Increase the focus on PJ_COORD as primary datatype: Eliminate use of PJ_TRIPLET etc. Trim proj.h by removing material that has become unnecessary. Improve constness Make proj_factors work in proj.h space, by providing a trimmed down PJ_FACTORS (which even has more meaningful field names) --- src/projects.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/projects.h') diff --git a/src/projects.h b/src/projects.h index 91c0e6a3..99df0e3e 100644 --- a/src/projects.h +++ b/src/projects.h @@ -178,7 +178,6 @@ union PJ_COORD; struct geod_geodesic; struct pj_opaque; struct ARG_list; -struct FACTORS; struct PJ_REGION_S; typedef struct PJ_REGION_S PJ_Region; typedef struct ARG_list paralist; /* parameter list */ @@ -704,8 +703,8 @@ double pj_authlat(double, double *); COMPLEX pj_zpoly1(COMPLEX, COMPLEX *, int); COMPLEX pj_zpolyd1(COMPLEX, COMPLEX *, int, COMPLEX *); -int pj_deriv(LP, double, PJ *, struct DERIVS *); -int pj_factors(LP, PJ *, double, struct FACTORS *); +int pj_deriv(LP, double, const PJ *, struct DERIVS *); +int pj_factors(LP, const PJ *, double, struct FACTORS *); struct PW_COEF { /* row coefficient structure */ int m; /* number of c coefficients (=0 for none) */ -- cgit v1.2.3