From bd6431c9129ddaa53e15a2a0c4d05796eb9595a9 Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Tue, 26 Mar 2024 17:12:14 -0400 Subject: [PATCH] Add multiparts to single part method --- scrub_layer_class.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scrub_layer_class.py b/scrub_layer_class.py index 1ea81eb..ad7107b 100644 --- a/scrub_layer_class.py +++ b/scrub_layer_class.py @@ -77,8 +77,11 @@ class ScrubLayer: def merge_layers(self, layers_path, mered_layer_path): pass - def multipart_to_singleparts(self): - pass + def multipart_to_singleparts(self, singleparts_layer_path): + QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms()) + params = {'INPUT': self.layer, + 'OUTPUT': singleparts_layer_path} + processing.run("native:multiparttosingleparts", params) def split_layer(self): pass