From f31ab5e42d8fd9c1527868dc7a4debb08a637e07 Mon Sep 17 00:00:00 2001 From: "Xavier C. Llano" Date: Sat, 21 Sep 2024 13:55:30 -0700 Subject: [PATCH] Ensure that geometry is ok when the sampling file has changed --- core/response_design.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/response_design.py b/core/response_design.py index 306e40e..384440e 100644 --- a/core/response_design.py +++ b/core/response_design.py @@ -116,6 +116,8 @@ def get_points_from_shapefile(self): points = [] for enum_id, qgs_feature in enumerate(self.sampling_layer.getFeatures(), start=1): geom = qgs_feature.geometry() + if not geom.isGeosValid(): + continue # get the id from shape file using column name "id" else use auto-enumeration attr_id = self.sampling_layer.fields().lookupField('id') if attr_id != -1: