[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-685-gf0cdb5af9

git at osgeo.org git at osgeo.org
Thu Mar 9 09:21:44 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, master has been updated
       via  f0cdb5af93e9d30a99648322ab6457e0bc2cc4b9 (commit)
      from  a3894467c6c6ca856a51cf993a4dc19730f42cec (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 f0cdb5af93e9d30a99648322ab6457e0bc2cc4b9
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:
 liblwgeom/lwalgorithm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list