[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.3-10-gd632374

git at osgeo.org git at osgeo.org
Wed Feb 17 16:06:16 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, stable-3.0 has been updated
       via  d6323743867da17c0fc94da397498f99521e9155 (commit)
       via  356d61e1afb4753d4639559ead55cdf8f6c1bae3 (commit)
      from  c84c3ecec68e10293193c5a5a131f2ff5611e135 (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 d6323743867da17c0fc94da397498f99521e9155
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Feb 17 16:06:11 2021 -0800

    Update NEWS for #4835

diff --git a/NEWS b/NEWS
index 8fa6fe5..0bcb7e4 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ PostGIS 3.0.3
   - #4790, Fix ST_3dintersects calculations with identical vertices (Nicklas Avén)
   - #4817, Handle complex compound coordinate systems (Paul Ramsey)
   - Support newer proj versions that have deprecated pj_get_release (Paul Ramsey)
+  - #4835, Adjust geodetic tolerance for calculations (Paul Ramsey)
 
 PostGIS 3.0.2
 2020/08/15

commit 356d61e1afb4753d4639559ead55cdf8f6c1bae3
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:
 NEWS                          | 1 +
 liblwgeom/cunit/cu_geodetic.c | 9 +++++++++
 liblwgeom/lwgeodetic.h        | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list