[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.1-13-g0bece15
git at osgeo.org
git at osgeo.org
Wed Feb 17 16:05:20 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.1 has been updated
via 0bece15c745d387c5006ce66ce845cadcc7986a7 (commit)
via 3afd8a1150b7cf6270da82c41b7747917d38af48 (commit)
from 03c008d81d76abe5cccb71f3783240ee97ac91af (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 0bece15c745d387c5006ce66ce845cadcc7986a7
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Wed Feb 17 16:05:16 2021 -0800
Update NEWS for #4835
diff --git a/NEWS b/NEWS
index 725aaa6..44d0283 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ PostGIS 3.1.2
- #4817, handle more complex compound coordinate dystems (Paul Ramsey)
- #4842, Only do axis flips on CRS that have a "Lat" as the first column (Paul Ramsey)
- Support recent Proj versions that have removed pj_get_release (Paul Ramsey)
+ - $4835, Adjust tolerance for geodetic calculations (Paul Ramsey)
PostGIS 3.1.1
commit 3afd8a1150b7cf6270da82c41b7747917d38af48
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