[SCM] PostGIS branch master updated. 3.4.0rc1-962-g7405b2076

git at osgeo.org git at osgeo.org
Fri Mar 1 14:09:09 PST 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, master has been updated
       via  7405b207637ace1f9bcd9477029e7ff57899d130 (commit)
      from  56023cc5b8fc6bb2f2a57483635e800c6c5eb446 (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 7405b207637ace1f9bcd9477029e7ff57899d130
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Mar 1 23:02:25 2024 +0100

    Don't let corrupted topology confuse lwt_GetFaceContainingPoint
    
    Print a user-friendly error message if a negative face identifier
    is found on the side of the closest edge. Returning it would
    make the caller think there was some other obscure error instead.

diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c
index 87f56d39e..40d27e38a 100644
--- a/liblwgeom/topo/lwgeom_topo.c
+++ b/liblwgeom/topo/lwgeom_topo.c
@@ -6148,6 +6148,22 @@ lwt_GetFaceContainingPoint(LWT_TOPOLOGY* topo, const LWPOINT* pt)
     return 0;
   }
 
+  if ( closestEdge->face_left < 0 )
+  {
+    lwerror("Closest edge %" LWTFMT_ELEMID " has invalid face %" LWTFMT_ELEMID
+			" on its left side", closestEdge->edge_id, closestEdge->face_left);
+    _lwt_release_edges(closestEdge, 1);
+    return -1;
+  }
+
+  if ( closestEdge->face_right < 0 )
+  {
+    lwerror("Closest edge %" LWTFMT_ELEMID " has invalid face %" LWTFMT_ELEMID
+			" on its right side", closestEdge->edge_id, closestEdge->face_right);
+    _lwt_release_edges(closestEdge, 1);
+    return -1;
+  }
+
   LWDEBUGGF(2, lwline_as_lwgeom(closestEdge->geom), "Closest edge %" LWTFMT_ELEMID, closestEdge->edge_id);
 
   /* Find closest segment of edge to the point */

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

Summary of changes:
 liblwgeom/topo/lwgeom_topo.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list