3

How do I delete features with identical table attributes in QGIS?

For example, if I had 4 rows, and 3 columns, where I wanted to delete identical features based on 2 columns:

1|A|m

2|A|m

3|A|p

4|B|m

I want it to be reduced to only 1 feature for each identical set of attributes:

1|A|m

3|A|p

4|B|m

In ArcGIS Desktop, this is a simple tool shown below called Delete Identical, where I can select one or more columns at the same time. I use this tool all the time, am switching to QGIS.

Is there a tool like the Delete Identical Tool in ArcGIS?

  • I posted this elsewhere in Stackoverflow, and it got downvoted -1 with no explanation. If you downvote, can you please tell me why?? – nittyjee Nov 10 '18 at 7:11
5

For future reference: the next version of qgis (3.6) includes a built in "remove duplicates by field value" tool which does exactly this.

3

In QGIS 3, you could use Add autoincremental field tool to distinguish identical set of attribute fields.

If your ABC field holds A, B, ... and mnp field holds m, p, ... like below image;

enter image description here

Select these ABC, mnp fields in the Group values by option, and keep other options at default setting.

enter image description here

This tool will return a new Incremental layer. You will see AUTO field with 0 and 1. (You may have 2 or bigger numbers if you have many duplicated records).

enter image description here

Select and highlight AUTO= 0 and go to Save As, using only selected features option.

  • How does your answer solve the problem that was to remove the duplicates? – user30184 Nov 10 '18 at 10:39
  • @user30184 I think it is the last part (saving only the record with 0), which creates new data without duplicates. – Kazuhito Nov 10 '18 at 10:45
  • Ok, I understand now. – user30184 Nov 10 '18 at 10:47
  • @Kazuhito Great, I'll check it out. Unfortunately, generating the original table is now not working for me - I've identified duplicate geometry in the past with ArcGIS using the "find identical" tool, choosing "shape", but it's not working. I'm trying to do it with QGIS as well. I don't want to delete features with identical geometry, I just want to add a common id for duplicates. Any idea on how to do that? I've posted this question here: gis.stackexchange.com/questions/302215/… – nittyjee Nov 11 '18 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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