[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0alpha1-104-ga533bf49e

git at osgeo.org git at osgeo.org
Thu Jun 30 12:12:29 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, master has been updated
       via  a533bf49ea7dd299bd60177d89c3761e18b526df (commit)
      from  45206b9a791ab160d3dffd76c0ba5416e1312533 (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 a533bf49ea7dd299bd60177d89c3761e18b526df
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 ea204fb12..87b4c1316 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -1237,7 +1237,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:
 liblwgeom/cunit/cu_geodetic.c | 9 +++++++++
 liblwgeom/lwgeodetic.c        | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list