[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc1-32-g995e5052d
git at osgeo.org
git at osgeo.org
Wed Aug 17 13:46:39 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 995e5052d56923ba8708914999478f57e9461b42 (commit)
from f79e7528a3795a0270aaf7a550e8ee31811057e7 (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 995e5052d56923ba8708914999478f57e9461b42
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:
liblwgeom/lwspheroid.c | 5 +++++
1 file changed, 5 insertions(+)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list