diff --git a/services_scripts/adding_area_field.py b/services_scripts/adding_area_field.py new file mode 100644 index 0000000..e69de29 diff --git a/services_scripts/multipart_to_singleparts.py b/services_scripts/multipart_to_singleparts.py new file mode 100644 index 0000000..4092cfb --- /dev/null +++ b/services_scripts/multipart_to_singleparts.py @@ -0,0 +1,23 @@ +from qgis.core import QgsApplication, QgsVectorLayer, QgsProcessingFeedback +from qgis.analysis import QgsNativeAlgorithms +import processing + +# Set the path to QGIS installation +QgsApplication.setPrefixPath("C:/Program Files/QGIS 3.34.1/apps/qgis", True) + +# Initialize QGIS application +qgs = QgsApplication([], False) +qgs.initQgis() + +# Add native algorithms provider +QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms()) + + +input_layer = 'C:/Users/a_adli/PycharmProjects/hydroquebec_archetype_gispy/data/output_data/delete_dups_4_partitioned|layername=delete_dups__partitioned' +singled_parts_layer = 'C:/Users/a_adli/PycharmProjects/hydroquebec_archetype_gispy/data/output_data/multi_to_single/multi_to_single2.shp' + +params = {'INPUT': input_layer, + 'OUTPUT': singled_parts_layer} +processing.run("native:multiparttosingleparts", params) + +qgs.exitQgis()