Add delete duplicate in the services package
This commit is contained in:
parent
d5893cdcdc
commit
42e23e12f4
21
services_scripts/delete_duplicates.py
Normal file
21
services_scripts/delete_duplicates.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user