diff --git a/src/cplus_plugin/tasks.py b/src/cplus_plugin/tasks.py index c5877535..d891fafe 100644 --- a/src/cplus_plugin/tasks.py +++ b/src/cplus_plugin/tasks.py @@ -1416,10 +1416,10 @@ def run_internal_activities_masking( if len(masking_layers) < 1: self.log_message( - f"Skipping activities masking " + f"Skipping activity masking " f"No mask layer(s) for activity {activity.name}" ) - return False + continue if len(masking_layers) > 1: initial_mask_layer = self.merge_vector_layers(masking_layers) else: @@ -1428,10 +1428,10 @@ def run_internal_activities_masking( if not initial_mask_layer.isValid(): self.log_message( - f"Skipping activities masking " + f"Skipping activity masking " f"using layer {mask_layer_path}, not a valid layer." ) - return False + continue # see https://qgis.org/pyqgis/master/core/Qgis.html#qgis.core.Qgis.GeometryType if Qgis.versionInt() < 33000: @@ -1445,10 +1445,10 @@ def run_internal_activities_masking( if not layer_check: self.log_message( - f"Skipping activities masking " + f"Skipping activity masking " f"using layer {mask_layer_path}, not a polygon layer." ) - return False + continue extent_layer = self.layer_extent(extent) @@ -1457,14 +1457,14 @@ def run_internal_activities_masking( "Skipping masking, the mask layers crs" " do not match the scenario crs." ) - return False + continue if not extent_layer.extent().intersects(initial_mask_layer.extent()): self.log_message( "Skipping masking, the mask layers extent" " and the scenario extent do not overlap." ) - return False + continue mask_layer = self.mask_layer_difference( initial_mask_layer, extent_layer @@ -1475,22 +1475,22 @@ def run_internal_activities_masking( if not mask_layer.isValid(): self.log_message( - f"Skipping activities masking " + f"Skipping activity masking " f"the created difference mask layer {mask_layer.source()}," f"is not a valid layer." ) - return False + continue if activity.path is None or activity.path == "": if not self.processing_cancelled: self.set_info_message( tr( - f"Problem when masking activities, " + f"Problem when masking activity, " f"there is no map layer for the activity {activity.name}" ), level=Qgis.Critical, ) self.log_message( - f"Problem when masking activities, " + f"Problem when masking activity, " f"there is no map layer for the activity {activity.name}" ) else: @@ -1501,7 +1501,7 @@ def run_internal_activities_masking( ) self.log_message(f"Processing has been cancelled by the user.") - return False + continue masked_activities_directory = os.path.join( self.scenario_directory, "final_masked_activities" @@ -1525,14 +1525,14 @@ def run_internal_activities_masking( f"Skipping masking, activity layer and" f" mask layer(s) have different CRS" ) - return False + continue if not activity_layer.extent().intersects(mask_layer.extent()): self.log_message( "Skipping masking, the extents of the activity layer " "and mask layers do not overlap." ) - return False + continue # Actual processing calculation alg_params = { @@ -1546,7 +1546,7 @@ def run_internal_activities_masking( } self.log_message( - f"Used parameters for masking the activities: {alg_params} \n" + f"Used parameters for masking the activity {activity.name}: {alg_params} \n" ) feedback = QgsProcessingFeedback()