Select to view content in your preferred language

How to merge several features into the most repeated one automatically?

288
1
07-05-2022 11:09 AM
Bobbyrezvani
New Contributor

Hello everyone,

If you look at the attached attribute table, there are features whose "id" are all the same but some of their "lucode" are different. In the "lucode" field, "AC67" has the majority over "PG01" and "TC01". 

I want to know if there's a way or code or tool that enables me to merge the features with the same "id" into one feature which obviously will have the same "id" and the most repeated "lucode" which is "AC67"? 

Thank you all in advance!

0 Kudos
1 Reply
DanLee
by Esri Regular Contributor
Esri Regular Contributor

I am not clear which of following cases you are referring to.

1. If you meant to removed the duplicate records and only keep one of them, you can use Delete Identical with the two fields as the Fields.

https://pro.arcgis.com/en/pro-app/2.9/tool-reference/data-management/delete-identical.htm

2. If you meant to merge/combine features that have same values in the two fields, try Dissolve with the two fields as Dissolve Fields.

https://pro.arcgis.com/en/pro-app/2.9/tool-reference/data-management/dissolve.htm