0

The QGIS "remove duplicates by attribute" tool allows you to remove duplicates across multiple fields.

But how can I list multiple fields when I run this tool with pyqgis processing?

alg_params = {
    'INPUT': Layer,
    'FIELDS': ['field_1', 'field_2'], # does not work
    'OUTPUT': 'TEMPORARY_OUTPUT'
}
fixLayer = processing.run("native:removeduplicatesbyattribute", alg_params)['OUTPUT']

1 Answer 1

1

The correct syntax for listing fields in pyqgis processing is:

'FIELDS': 'osm_id;osm_way_id',

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.