[SCM] PostGIS branch stable-3.4 updated. 3.4.2-47-g940798dd7

git at osgeo.org git at osgeo.org
Fri Aug 2 13:26:25 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  940798dd7486499447b35c46666d584e7a2ef2f5 (commit)
       via  d16152b9300fb97f30488e6b438851a8cbaba1f1 (commit)
       via  bea6e61f49687cbdddcb02b94a8990b508ce5d73 (commit)
      from  4c8093b58e672047ba1ed925be59842f1dc9943b (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 940798dd7486499447b35c46666d584e7a2ef2f5
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 2 13:26:20 2024 -0700

    News entry for 5752

diff --git a/NEWS b/NEWS
index f80a6ad5b..55a541b9b 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
           itself (Paul Ramsey)
  - #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)
 
 PostGIS 3.4.2
 2024/02/08

commit d16152b9300fb97f30488e6b438851a8cbaba1f1
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 2 13:22:24 2024 -0700

    Return the appropriate closest points in the geography close point calculation, references #5752

diff --git a/liblwgeom/cunit/cu_geodetic.c b/liblwgeom/cunit/cu_geodetic.c
index 5e89aef3b..98d598e67 100644
--- a/liblwgeom/cunit/cu_geodetic.c
+++ b/liblwgeom/cunit/cu_geodetic.c
@@ -1593,6 +1593,7 @@ static void test_lwgeom_area_sphere(void)
 	/* end #3393 */
 }
 
+
 static void test_gbox_to_string_truncated(void)
 {
 	GBOX g = {
diff --git a/liblwgeom/cunit/cu_tree.c b/liblwgeom/cunit/cu_tree.c
index ce46c1c4f..c60e4e72d 100644
--- a/liblwgeom/cunit/cu_tree.c
+++ b/liblwgeom/cunit/cu_tree.c
@@ -419,6 +419,27 @@ static void test_tree_circ_distance_threshold(void)
 
 }
 
+static void test_geography_tree_closestpoint(void)
+{
+	LWGEOM *lwg1, *lwg2, *lwg3;
+	LWPOINT *lwpt;
+	POINT2D pt;
+
+	/* Simple case */
+	lwg1 = lwgeom_from_wkt("LINESTRING (18 9, 18 1)", LW_PARSER_CHECK_NONE);
+	lwg2 = lwgeom_from_wkt("POINT (16 4)", LW_PARSER_CHECK_NONE);
+	lwg3 = geography_tree_closestpoint(lwg1, lwg2, 0.1);
+	lwpt = (LWPOINT *)lwg3;
+
+	lwpoint_getPoint2d_p(lwpt, &pt);
+	CU_ASSERT_DOUBLE_EQUAL(pt.x, 18, 0.0001);
+	CU_ASSERT_DOUBLE_EQUAL(pt.y, 4.0024302, 0.0001);
+
+	lwgeom_free(lwg1);
+	lwgeom_free(lwg2);
+	lwgeom_free(lwg3);
+}
+
 /*
 ** Used by test harness to register the tests in this file.
 */
@@ -431,4 +452,5 @@ void tree_suite_setup(void)
 	PG_ADD_TEST(suite, test_tree_circ_pip2);
 	PG_ADD_TEST(suite, test_tree_circ_distance);
 	PG_ADD_TEST(suite, test_tree_circ_distance_threshold);
+	PG_ADD_TEST(suite, test_geography_tree_closestpoint);
 }
diff --git a/liblwgeom/lwgeodetic_tree.c b/liblwgeom/lwgeodetic_tree.c
index a425046a0..cbede3750 100644
--- a/liblwgeom/lwgeodetic_tree.c
+++ b/liblwgeom/lwgeodetic_tree.c
@@ -770,11 +770,11 @@ circ_tree_distance_tree_internal(const CIRC_NODE* n1, const CIRC_NODE* n2, doubl
 			/* Node 2 is a point */
 			else
 			{
-				geographic_point_init(n2->p1->x, n2->p1->y, &gp1);
+				geographic_point_init(n2->p1->x, n2->p1->y, &gp2);
 				geographic_point_init(n1->p1->x, n1->p1->y, &(e.start));
 				geographic_point_init(n1->p2->x, n1->p2->y, &(e.end));
-				close1 = gp1;
-				d = edge_distance_to_point(&e, &gp1, &close2);
+				close2 = gp2;
+				d = edge_distance_to_point(&e, &gp2, &close1);
 			}
 			LWDEBUGF(4, "  got distance %g", d);
 		}
diff --git a/regress/core/geography_expected b/regress/core/geography_expected
index a7062388c..a5ead8c91 100644
--- a/regress/core/geography_expected
+++ b/regress/core/geography_expected
@@ -66,4 +66,4 @@ lrs_llp_2|0.00
 lrs_llp_3|1.00
 ERROR:  geography_line_locate_point: 2st arg is not a point
 lrs_substr_1|LINESTRING(9.28 23.25,18.97 25.93)
-lrs_sl_1|LINESTRING(25 40,25 42.79)
+lrs_sl_1|LINESTRING(25 42.79,25 40)

commit bea6e61f49687cbdddcb02b94a8990b508ce5d73
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 3 15:13:56 2024 -0700

    Bring fixes to script back from head

diff --git a/utils/check_tests_enabled.sh b/utils/check_tests_enabled.sh
index caaca5ceb..3b3d3e298 100755
--- a/utils/check_tests_enabled.sh
+++ b/utils/check_tests_enabled.sh
@@ -1,4 +1,3 @@
-
 #!/bin/sh
 
 usage() {
@@ -33,6 +32,7 @@ check_enabled() {
   #cat ${TMPDIR}/enabled_tests
 
   find ${bd} -name '*_expected' |
+    sed 's|//|/|' |
     sed 's|_expected$||' > ${TMPDIR}/available_tests
 
   #cat ${TMPDIR}/available_tests

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

Summary of changes:
 NEWS                            |  1 +
 liblwgeom/cunit/cu_geodetic.c   |  1 +
 liblwgeom/cunit/cu_tree.c       | 22 ++++++++++++++++++++++
 liblwgeom/lwgeodetic_tree.c     |  6 +++---
 regress/core/geography_expected |  2 +-
 utils/check_tests_enabled.sh    |  2 +-
 6 files changed, 29 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list