diff --git a/services_scripts/delete_duplicates.py b/services_scripts/delete_duplicates.py new file mode 100644 index 0000000..1ee4a27 --- /dev/null +++ b/services_scripts/delete_duplicates.py @@ -0,0 +1,21 @@ +from qgis.core import QgsApplication, QgsVectorLayer, QgsProcessingFeedback +from qgis.analysis import QgsNativeAlgorithms +import processing + +# In QGIS Delete Identical is named Delete Duplicates +# 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()) +layer = 'C:/Users/a_adli/PycharmProjects/hydroquebec_archetype_gispy/data/aEndeavor/merged_all_delete_columns/merge_divisions.shp' + +params = {'INPUT':'C:/Users/a_adli/PycharmProjects/hydroquebec_archetype_gispy/history/aEndeavor/qgis_spatial_pariwiseunitNrcan_geo|layername=spatial_with_geo', + 'OUTPUT':'C:/Users/a_adli/PycharmProjects/hydroquebec_archetype_gispy/history/aEndeavor/empty/delete_duplicates_02.shp'} +processing.run("native:deleteduplicategeometries", params) + +qgs.exitQgis() \ No newline at end of file