[postgis-tickets] [SCM] PostGIS branch stable-2.5 updated. 2.5.7-30-g68e1054bb

git at osgeo.org git at osgeo.org
Wed Aug 17 13:51: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-2.5 has been updated
       via  68e1054bb046863fcf77dc62c09da6fdbbcdc09e (commit)
       via  612c3aa93a610cf67fb95054695b51c63a5967ce (commit)
      from  bc3e86487e0c3d1588a1c262d701798893dc7d32 (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 68e1054bb046863fcf77dc62c09da6fdbbcdc09e
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Aug 17 13:51:35 2022 -0700

    News entry for #5171

diff --git a/NEWS b/NEWS
index 3032aa435..c510fa3bf 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ PostGIS 2.5.8dev
 
   - #5202, Guard against downgrades (Sandro Santilli)
   - #5209, #5210, Fix upgrades with CVE-2022-2625 PostgreSQL fix
+  - #5171, Short circuit geodesic distance when inputs equal (Paul Ramsey)
 
 PostGIS 2.5.7
 2022/07/19

commit 612c3aa93a610cf67fb95054695b51c63a5967ce
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Aug 17 13:45:41 2022 -0700

    Short circuit geodesic distance when input points are equal (References #5171)

diff --git a/liblwgeom/lwspheroid.c b/liblwgeom/lwspheroid.c
index 66322917a..fe8cb2769 100644
--- a/liblwgeom/lwspheroid.c
+++ b/liblwgeom/lwspheroid.c
@@ -79,6 +79,11 @@ static double spheroid_big_b(double u2)
 double spheroid_distance(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid)
 {
 	struct geod_geodesic gd;
+
+	/* Same point => zero distance */
+	if ( geographic_point_equals(a, b) )
+		return 0.0;
+
 	geod_init(&gd, spheroid->a, spheroid->f);
 	double lat1 = a->lat * 180.0 / M_PI;
 	double lon1 = a->lon * 180.0 / M_PI;

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

Summary of changes:
 NEWS                   | 1 +
 liblwgeom/lwspheroid.c | 5 +++++
 2 files changed, 6 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list