From 51c779fed7215f152e88bea51aba20a81a819737 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 13 Nov 2023 14:55:44 +0000 Subject: [PATCH] Catch GEOSException, as recommended in #66 --- src/snkit/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snkit/network.py b/src/snkit/network.py index 1917cd4..40979f2 100644 --- a/src/snkit/network.py +++ b/src/snkit/network.py @@ -786,7 +786,7 @@ def _intersects( buf = geom try: return _intersects_gdf(buf, gdf) - except shapely.errors.TopologicalError: + except (shapely.errors.TopologicalError, shapely.errors.GEOSException): # can exceptionally buffer to an invalid geometry, so try re-buffering buf = buf.buffer(0) return _intersects_gdf(buf, gdf)