[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-79-ga3d4f6f
git at osgeo.org
git at osgeo.org
Wed Feb 17 16:04:27 PST 2021
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via a3d4f6f3b9282881e05dcdf14f5a7575e518d78b (commit)
from 7e6e08512ade1c3ca14d191894d8737480e59ada (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a3d4f6f3b9282881e05dcdf14f5a7575e518d78b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Wed Feb 17 15:56:23 2021 -0800
Adjust geodetic tolerance, references #4835
diff --git a/liblwgeom/cunit/cu_geodetic.c b/liblwgeom/cunit/cu_geodetic.c
index ebe87cb..3021bc5 100644
--- a/liblwgeom/cunit/cu_geodetic.c
+++ b/liblwgeom/cunit/cu_geodetic.c
@@ -1184,6 +1184,15 @@ static void test_lwgeom_distance_sphere(void)
spheroid_init(&s, 6378137.0, 6356752.314245179498);
s.a = s.b = s.radius;
+ /* https://trac.osgeo.org/postgis/ticket/4835 */
+ lwg1 = lwgeom_from_wkt("POINT(0 90)", LW_PARSER_CHECK_NONE);
+ lwg2 = lwgeom_from_wkt("LINESTRING(-166.11 68.875,15.55 78.216667)", LW_PARSER_CHECK_NONE);
+ d = lwgeom_distance_spheroid(lwg1, lwg2, &s, 0.0);
+ // printf("%12.8g\n", d);
+ CU_ASSERT_DOUBLE_EQUAL(d, 25003.707, 0.1);
+ lwgeom_free(lwg1);
+ lwgeom_free(lwg2);
+
/* Line/line distance, 1 degree apart */
lwg1 = lwgeom_from_wkt("LINESTRING(-30 10, -20 5, -10 3, 0 1)", LW_PARSER_CHECK_NONE);
lwg2 = lwgeom_from_wkt("LINESTRING(-10 -5, -5 0, 5 0, 10 -5)", LW_PARSER_CHECK_NONE);
diff --git a/liblwgeom/lwgeodetic.h b/liblwgeom/lwgeodetic.h
index 3a500e5..6364db2 100644
--- a/liblwgeom/lwgeodetic.h
+++ b/liblwgeom/lwgeodetic.h
@@ -40,7 +40,7 @@
/* Override tolerance for geodetic */
#ifdef FP_TOLERANCE
#undef FP_TOLERANCE
-#define FP_TOLERANCE 1e-14
+#define FP_TOLERANCE 5e-14
#endif
extern int gbox_geocentric_slow;
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/cunit/cu_geodetic.c | 9 +++++++++
liblwgeom/lwgeodetic.h | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list