[SCM] PostGIS branch stable-3.4 updated. 3.4.2-49-gc1b8e12c3

git at osgeo.org git at osgeo.org
Fri Aug 2 16:49:46 PDT 2024


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.4 has been updated
       via  c1b8e12c3fb15fceb23f2e7949bfbd87c5da3b10 (commit)
       via  f2bf5ced9d8b6ba1262f1e336e260d78dc86a1bb (commit)
      from  940798dd7486499447b35c46666d584e7a2ef2f5 (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 c1b8e12c3fb15fceb23f2e7949bfbd87c5da3b10
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 2 16:49:41 2024 -0700

    NEWS for #5740

diff --git a/NEWS b/NEWS
index 55a541b9b..b61d82cf8 100644
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
  - #5720, Correctly mangle special column names in shp2pgsql (Paul Ramsey)
  - #5734, Estimate geography extent more correctly (Paul Ramsey)
  - #5752, ST_ClosestPoint(geography) error (Paul Ramsey)
+ - #5740, ST_DistanceSpheroid(geometry) incorrectly handles polygons (Paul Ramsey)
 
 PostGIS 3.4.2
 2024/02/08

commit f2bf5ced9d8b6ba1262f1e336e260d78dc86a1bb
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 2 16:29:15 2024 -0700

    Error in ST_DistanceSpheroid due to planar box leaking into geodetic code, references #5740

diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index 176c5ed2c..8afffa8e2 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -2088,13 +2088,13 @@ double lwgeom_distance_spheroid(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2, co
 	type2 = lwgeom2->type;
 
 	/* Make sure we have boxes */
-	if ( lwgeom1->bbox )
+	if ( FLAGS_GET_GEODETIC(lwgeom1->flags) && lwgeom1->bbox )
 		gbox1 = *(lwgeom1->bbox);
 	else
 		lwgeom_calculate_gbox_geodetic(lwgeom1, &gbox1);
 
 	/* Make sure we have boxes */
-	if ( lwgeom2->bbox )
+	if ( FLAGS_GET_GEODETIC(lwgeom2->flags) && lwgeom2->bbox )
 		gbox2 = *(lwgeom2->bbox);
 	else
 		lwgeom_calculate_gbox_geodetic(lwgeom2, &gbox2);
diff --git a/postgis/lwgeom_spheroid.c b/postgis/lwgeom_spheroid.c
index 3b6f0b2bb..b313ab7e5 100644
--- a/postgis/lwgeom_spheroid.c
+++ b/postgis/lwgeom_spheroid.c
@@ -521,6 +521,8 @@ Datum geometry_distance_spheroid(PG_FUNCTION_ARGS)
 	/* We are going to be calculating geodetic distances */
 	lwgeom_set_geodetic(lwgeom1, LW_TRUE);
 	lwgeom_set_geodetic(lwgeom2, LW_TRUE);
+	lwgeom_refresh_bbox(lwgeom1);
+	lwgeom_refresh_bbox(lwgeom2);
 
 	distance = lwgeom_distance_spheroid(lwgeom1, lwgeom2, sphere, 0.0);
 

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

Summary of changes:
 NEWS                      | 1 +
 liblwgeom/lwgeodetic.c    | 4 ++--
 postgis/lwgeom_spheroid.c | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list