[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.6-31-gdfcc4326f
git at osgeo.org
git at osgeo.org
Wed Aug 17 13:50:00 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 dfcc4326f5ff39e2d45896b290043387ab2fcb45 (commit)
via c10f3bbe7e9627305f5af77bc6012c2c82503b8b (commit)
from d29282e5f93f697e600df2bd49438fefb02da9a1 (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 dfcc4326f5ff39e2d45896b290043387ab2fcb45
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Wed Aug 17 13:49:48 2022 -0700
News entry for #5171
diff --git a/NEWS b/NEWS
index d5c54593c..cf4230749 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,8 @@ PostGIS 3.1.7dev
- #5202, Guard against downgrades (Sandro Santilli)
- #5209, #5210, Fix upgrades with CVE-2022-2625 PostgreSQL fix
- #5032, Correctly read extent off multi-key GIST indexes (Paul Ramsey)
- - #5171, Reset proj error state after failed parse (Paul Ramsey)
+ - #5181, Reset proj error state after failed parse (Paul Ramsey)
+ - #5171, Short circuit geodesic distance when inputs equal (Paul Ramsey)
PostGIS 3.1.6
commit c10f3bbe7e9627305f5af77bc6012c2c82503b8b
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 59368db42..bf8c5cbef 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 | 3 ++-
liblwgeom/lwspheroid.c | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list