[postgis-tickets] [SCM] PostGIS branch stable-3.2 updated. 3.2.4-13-g38190a2d8

git at osgeo.org git at osgeo.org
Thu Mar 9 09:24:20 PST 2023


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.2 has been updated
       via  38190a2d824a63f6ff4083fc02ae3e4e8b8b506f (commit)
       via  6b6f6cf91ae68beb98c81e58051cae36ad5333aa (commit)
      from  bac93bda9f9a0d147fbbcda34949a59e0fa7f4b7 (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 38190a2d824a63f6ff4083fc02ae3e4e8b8b506f
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Mar 9 09:24:15 2023 -0800

    NEWS entry for #5288

diff --git a/NEWS b/NEWS
index db467f09e..818b0b93b 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ Proj 6.1+, and PostgreSQL 14+.
   - #5315, #5318, #5319, #5320, #5342 crashes on infinite coordinates
           (Regina Obe, Paul Ramsey)
   - #5344, Include topology id sequence state in dumps (Sandro Santilli)
+  - #5288, ST_LineCrossingDirection multi-cross error (Paul Ramsey)
+
 
 PostGIS 3.2.4
 2022/11/12

commit 6b6f6cf91ae68beb98c81e58051cae36ad5333aa
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Mar 9 09:18:11 2023 -0800

    Correctly handle multi-cross case in ST_LineCrossingDirection. Closes #5288

diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c
index eb9febad8..5d2fffb17 100644
--- a/liblwgeom/lwalgorithm.c
+++ b/liblwgeom/lwalgorithm.c
@@ -479,6 +479,11 @@ int lwline_crossing_direction(const LWLINE *l1, const LWLINE *l2)
 	if ( pa1->npoints < 2 || pa2->npoints < 2 )
 		return LINE_NO_CROSS;
 
+	/* Zero length lines don't have a side. */
+	if ( ptarray_length_2d(pa1) == 0 || ptarray_length_2d(pa2) == 0 )
+		return LINE_NO_CROSS;
+
+
 #if POSTGIS_DEBUG_LEVEL >= 4
 	geom_ewkt = lwgeom_to_ewkt((LWGEOM*)l1);
 	LWDEBUGF(4, "l1 = %s", geom_ewkt);
@@ -523,7 +528,7 @@ int lwline_crossing_direction(const LWLINE *l1, const LWLINE *l2)
 				LWDEBUG(4,"this_cross == SEG_CROSS_RIGHT");
 				cross_right++;
 				if ( ! first_cross )
-					first_cross = SEG_CROSS_LEFT;
+					first_cross = SEG_CROSS_RIGHT;
 			}
 
 			/*

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

Summary of changes:
 NEWS                    | 2 ++
 liblwgeom/lwalgorithm.c | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list