[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.8-9-g7596f7e6a

git at osgeo.org git at osgeo.org
Thu Mar 9 09:26:08 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.0 has been updated
       via  7596f7e6a6708c00784fbcca151b121bf4515d82 (commit)
       via  99eac803170511cf8d043ddf5b3079968dfd1f67 (commit)
      from  b30c2b813e995ce117687b3b1c603141bfd534f3 (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 7596f7e6a6708c00784fbcca151b121bf4515d82
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Mar 9 09:25:59 2023 -0800

    NEWS entry for #5288

diff --git a/NEWS b/NEWS
index b0be3c875..a0e67e4f2 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ xxxx/xx/xx
   - #5315, #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.0.8
 2022/11/11

commit 99eac803170511cf8d043ddf5b3079968dfd1f67
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 1a2b8237a..96a724d4c 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                    | 1 +
 liblwgeom/lwalgorithm.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list