From c5336caf37786fcea71c69f5372ac5ae66920770 Mon Sep 17 00:00:00 2001 From: Alexandre Barreto Date: Thu, 5 Jan 2023 13:44:16 -0500 Subject: [PATCH] install.rst: improve instructions regarding proj-data (fixes #3539) --- docs/source/install.rst | 5 +++ src/geodesic.c | 68 ++++++++++++++++++++++++++++++++++++++++ src/geodesic.h | 4 +++ src/init.cpp | 4 +++ src/tests/geodsigntest.c | 25 +++++++++++++++ 5 files changed, 106 insertions(+) diff --git a/docs/source/install.rst b/docs/source/install.rst index e3ec5c151b3f..3936b63230e8 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -1453,6 +1453,7 @@ can be modified to suit the users needs. See :ref:`projsync` for more options. <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -2058,6 +2059,10 @@ can be modified to suit the users needs. See :ref:`projsync` for more options. package can be downloaded and added to the :envvar:`PROJ_DATA` directory (called ``PROJ_LIB`` before PROJ 9.1) >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + package can be downloaded and its content decompressed into one of the + directories where PROJ looks for :ref:`resources ` +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) Starting with PROJ 9.2, a ``uninstall`` target is available to remove files installed by the ``install`` target:: diff --git a/src/geodesic.c b/src/geodesic.c index c2be47100880..bdc70b4609ef 100644 --- a/src/geodesic.c +++ b/src/geodesic.c @@ -120,6 +120,7 @@ static void Init(void) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -676,6 +677,9 @@ static void Init(void) { ======= tolb = tol0 * tol2; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + tolb = tol0; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) xthresh = 1000 * tol2; degree = pi/hd; NaN = nan("0"); @@ -752,6 +756,7 @@ static double sumx(double u, double v, double* t) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -1308,6 +1313,9 @@ static double polyval(int N, const double p[], double x) { ======= static double polyval(int N, const double p[], double x) { >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +static double polyvalx(int N, const double p[], double x) { +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) double y = N < 0 ? 0 : *p++; while (--N >= 0) y = y * x + *p++; return y; @@ -2118,6 +2126,7 @@ static double geod_geninverse_int(const struct geod_geodesic* g, <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -2674,6 +2683,9 @@ static double geod_geninverse_int(const struct geod_geodesic* g, ======= for (; numit < maxit2; ++numit) { >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + for (;; ++numit) { +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) /* the WGS84 test set: mean = 1.47, sd = 1.25, max = 16 * WGS84 and random input: mean = 2.85, sd = 0.60 */ double dv = 0, @@ -2724,6 +2736,7 @@ static double geod_geninverse_int(const struct geod_geodesic* g, <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -2954,6 +2967,8 @@ static double geod_geninverse_int(const struct geod_geodesic* g, >>>>>>> b1527fbb85 (install.rst: improve instructions regarding proj-data (fixes #3539)) ======= >>>>>>> da73f22a17 (install.rst: improve instructions regarding proj-data (fixes #3539)) +======= +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) if (tripb || /* Reversed test to allow escape with NaNs */ !(fabs(v) >= (tripn ? 8 : 1) * tol0) || @@ -2990,6 +3005,7 @@ static double geod_geninverse_int(const struct geod_geodesic* g, <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> c98204a06c (install.rst: improve instructions regarding proj-data (fixes #3539)) ======= @@ -3478,6 +3494,8 @@ static double geod_geninverse_int(const struct geod_geodesic* g, /* Reversed test to allow escape with NaNs */ if (tripb || !(fabs(v) >= (tripn ? 8 : 1) * tol0)) break; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) /* Update bracketing values */ if (v > 0 && (numit > maxit1 || calp1/salp1 > calp1b/salp1b)) { salp1b = salp1; calp1b = calp1; } @@ -3529,6 +3547,7 @@ static double geod_geninverse_int(const struct geod_geodesic* g, <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -3759,6 +3778,8 @@ static double geod_geninverse_int(const struct geod_geodesic* g, >>>>>>> b1527fbb85 (install.rst: improve instructions regarding proj-data (fixes #3539)) ======= >>>>>>> da73f22a17 (install.rst: improve instructions regarding proj-data (fixes #3539)) +======= +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) if (fabs(dalp1) < pi) { double sdalp1 = sin(dalp1), cdalp1 = cos(dalp1), @@ -3803,6 +3824,7 @@ static double geod_geninverse_int(const struct geod_geodesic* g, <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> 8d733d2079 (install.rst: improve instructions regarding proj-data (fixes #3539)) @@ -4431,6 +4453,8 @@ static double geod_geninverse_int(const struct geod_geodesic* g, >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) ======= >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) } } /* Either dv was not positive or updated value was outside legal @@ -5045,6 +5069,7 @@ double A3f(const struct geod_geodesic* g, double eps) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -5601,6 +5626,9 @@ double A3f(const struct geod_geodesic* g, double eps) { ======= return polyval(nA3 - 1, g->A3x, eps); >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + return polyvalx(nA3 - 1, g->A3x, eps); +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) } void C3f(const struct geod_geodesic* g, double eps, double c[]) { @@ -5654,6 +5682,7 @@ void C3f(const struct geod_geodesic* g, double eps, double c[]) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -6210,6 +6239,9 @@ void C3f(const struct geod_geodesic* g, double eps, double c[]) { ======= c[l] = mult * polyval(m, g->C3x + o, eps); >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + c[l] = mult * polyvalx(m, g->C3x + o, eps); +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 1; } } @@ -6264,6 +6296,7 @@ void C4f(const struct geod_geodesic* g, double eps, double c[]) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -6820,6 +6853,9 @@ void C4f(const struct geod_geodesic* g, double eps, double c[]) { ======= c[l] = mult * polyval(m, g->C4x + o, eps); >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + c[l] = mult * polyvalx(m, g->C4x + o, eps); +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 1; mult *= eps; } @@ -6875,6 +6911,7 @@ double A1m1f(double eps) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -7431,6 +7468,9 @@ double A1m1f(double eps) { ======= double t = polyval(m, coeff, sq(eps)) / coeff[m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + double t = polyvalx(m, coeff, sq(eps)) / coeff[m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) return (t + eps) / (1 - eps); } @@ -7499,6 +7539,7 @@ void C1f(double eps, double c[]) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -8055,6 +8096,9 @@ void C1f(double eps, double c[]) { ======= c[l] = d * polyval(m, coeff + o, eps2) / coeff[o + m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + c[l] = d * polyvalx(m, coeff + o, eps2) / coeff[o + m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 2; d *= eps; } @@ -8125,6 +8169,7 @@ void C1pf(double eps, double c[]) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -8681,6 +8726,9 @@ void C1pf(double eps, double c[]) { ======= c[l] = d * polyval(m, coeff + o, eps2) / coeff[o + m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + c[l] = d * polyvalx(m, coeff + o, eps2) / coeff[o + m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 2; d *= eps; } @@ -8736,6 +8784,7 @@ double A2m1f(double eps) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -9292,6 +9341,9 @@ double A2m1f(double eps) { ======= double t = polyval(m, coeff, sq(eps)) / coeff[m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + double t = polyvalx(m, coeff, sq(eps)) / coeff[m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) return (t - eps) / (1 + eps); } @@ -9360,6 +9412,7 @@ void C2f(double eps, double c[]) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -9916,6 +9969,9 @@ void C2f(double eps, double c[]) { ======= c[l] = d * polyval(m, coeff + o, eps2) / coeff[o + m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + c[l] = d * polyvalx(m, coeff + o, eps2) / coeff[o + m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 2; d *= eps; } @@ -9983,6 +10039,7 @@ void A3coeff(struct geod_geodesic* g) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -10539,6 +10596,9 @@ void A3coeff(struct geod_geodesic* g) { ======= g->A3x[k++] = polyval(m, coeff + o, g->n) / coeff[o + m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + g->A3x[k++] = polyvalx(m, coeff + o, g->n) / coeff[o + m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 2; } } @@ -10624,6 +10684,7 @@ void C3coeff(struct geod_geodesic* g) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -11180,6 +11241,9 @@ void C3coeff(struct geod_geodesic* g) { ======= g->C3x[k++] = polyval(m, coeff + o, g->n) / coeff[o + m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + g->C3x[k++] = polyvalx(m, coeff + o, g->n) / coeff[o + m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 2; } } @@ -11278,6 +11342,7 @@ void C4coeff(struct geod_geodesic* g) { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -11834,6 +11899,9 @@ void C4coeff(struct geod_geodesic* g) { ======= g->C4x[k++] = polyval(m, coeff + o, g->n) / coeff[o + m + 1]; >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + g->C4x[k++] = polyvalx(m, coeff + o, g->n) / coeff[o + m + 1]; +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) o += m + 2; } } diff --git a/src/geodesic.h b/src/geodesic.h index 8134569538fa..b5134644c65d 100644 --- a/src/geodesic.h +++ b/src/geodesic.h @@ -74,6 +74,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -630,6 +631,9 @@ ======= #define GEODESIC_VERSION_MINOR 0 >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +#define GEODESIC_VERSION_MINOR 1 +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) /** * The patch level of the geodesic library. (This tracks the version of * GeographicLib.) diff --git a/src/init.cpp b/src/init.cpp index e2f466884730..124efc905bb4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -815,6 +815,7 @@ pj_init_ctx_with_allow_init_epsg(PJ_CONTEXT *ctx, int argc, char **argv, int all <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -1371,6 +1372,9 @@ pj_init_ctx_with_allow_init_epsg(PJ_CONTEXT *ctx, int argc, char **argv, int all ======= geod_init(PIN->geod, PIN->a, PIN->es / (1 + sqrt (PIN->one_es))); >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= + geod_init(PIN->geod, PIN->a, PIN->f); +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) /* Projection specific initialization */ err = proj_errno_reset (PIN); diff --git a/src/tests/geodsigntest.c b/src/tests/geodsigntest.c index cea495d5ebfd..0a085e460603 100644 --- a/src/tests/geodsigntest.c +++ b/src/tests/geodsigntest.c @@ -73,6 +73,7 @@ typedef double T; <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -303,6 +304,8 @@ typedef double T; >>>>>>> b1527fbb85 (install.rst: improve instructions regarding proj-data (fixes #3539)) ======= >>>>>>> da73f22a17 (install.rst: improve instructions regarding proj-data (fixes #3539)) +======= +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) #if !defined(OLD_BUGGY_REMQUO) /* * glibc prior to version 2.22 had a bug in remquo. This was reported in 2014 @@ -346,6 +349,7 @@ typedef double T; <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 2fd0015d5f (install.rst: improve instructions regarding proj-data (fixes #3539)) ======= @@ -776,6 +780,8 @@ typedef double T; >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) ======= >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) static const T wgs84_a = 6378137, wgs84_f = 1/298.257223563; /* WGS84 */ static int equiv(T x, T y) { @@ -912,6 +918,7 @@ int main() { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -1501,6 +1508,11 @@ int main() { ======= checksincosd(-810.0, -1.0, +0.0); >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +#if !OLD_BUGGY_REMQUO + checksincosd(-810.0, -1.0, +0.0); +#endif +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) checksincosd(-720.0, -0.0, +1.0); checksincosd(-630.0, +1.0, +0.0); checksincosd(-540.0, -0.0, -1.0); @@ -1562,6 +1574,7 @@ int main() { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> locationtech-main @@ -2137,10 +2150,15 @@ int main() { ======= ======= >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +#if !OLD_BUGGY_REMQUO +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) checksincosd(+810.0, +1.0, +0.0); +#endif checksincosd(+ inf, nan, nan); checksincosd( nan, nan, nan); +<<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD >>>>>>> 748ccdbcc6 (Merge pull request #3524 from cffk/merid-update-fix) @@ -2368,6 +2386,9 @@ int main() { >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) ======= >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +#if !OLD_BUGGY_REMQUO +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) { T s1, c1, s2, c2, s3, c3; geod_sincosd( 9.0, &s1, &c1); @@ -2421,6 +2442,7 @@ int main() { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) @@ -2945,6 +2967,9 @@ int main() { >>>>>>> 885e4882b8 (Merge pull request #3524 from cffk/merid-update-fix) ======= >>>>>>> 0a2f6458d1 (Merge pull request #3524 from cffk/merid-update-fix) +======= +#endif +>>>>>>> 9a55b4f828 (install.rst: improve instructions regarding proj-data (fixes #3539)) check( geod_atan2d(+0.0 , -0.0 ), +180 ); check( geod_atan2d(-0.0 , -0.0 ), -180 );