[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.5-25-g8e981ef02

git at osgeo.org git at osgeo.org
Thu Jun 30 12:15:40 PDT 2022


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  8e981ef02241fdd2062f069e33ace4fc20bebd1f (commit)
       via  4aad2983cda10a88625e2bd8aa2e0cfc76a62195 (commit)
      from  6a490715af54f1c41089f29a20f78da541e66e99 (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 8e981ef02241fdd2062f069e33ace4fc20bebd1f
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Jun 30 12:15:35 2022 -0700

    NEWS entry for #4835

diff --git a/NEWS b/NEWS
index 1eda07872..23ca3d556 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PostGIS 3.1.6dev
 2022/XX/XX
 
 * Bug Fixes
+  - #4835, Occasional distance errors in polar area (Paul Ramsey)
   - #5152, Fix infinite loop with ST_Split (Sandro Santilli)
   - #5120, Fix not-null result from ST_EstimatedExtent against
            truncated tables with spatial index (Sandro Santilli)

commit 4aad2983cda10a88625e2bd8aa2e0cfc76a62195
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Jun 30 12:11:51 2022 -0700

    For edge_distance_to_point test, do not check that candidate point is on the target plane: we already know it is because we deliberately constructed it to be there. References #4835

diff --git a/liblwgeom/cunit/cu_geodetic.c b/liblwgeom/cunit/cu_geodetic.c
index 3021bc54b..12506476d 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(45 90)", LW_PARSER_CHECK_NONE);
+	lwg2 = lwgeom_from_wkt("LINESTRING(15.55 78.216667, -164.58 68.875)", LW_PARSER_CHECK_NONE);
+	d = lwgeom_distance_spheroid(lwg1, lwg2, &s, 0.0);
+	// printf("%12.8g\n", d);
+	CU_ASSERT_DOUBLE_EQUAL(d, 1958.2179, 0.1);
+	lwgeom_free(lwg1);
+	lwgeom_free(lwg2);
+
 	/* 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);
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index f847bb470..601928568 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -1235,7 +1235,7 @@ double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *
 	vector_difference(&p, &n, &k);
 	normalize(&k);
 	cart2geog(&k, &gk);
-	if ( edge_contains_point(e, &gk) )
+	if ( edge_point_in_cone(e, &gk) )
 	{
 		d1 = sphere_distance(gp, &gk);
 	}

-----------------------------------------------------------------------

Summary of changes:
 NEWS                          | 1 +
 liblwgeom/cunit/cu_geodetic.c | 9 +++++++++
 liblwgeom/lwgeodetic.c        | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list