0

I have a landcover polygon that I spatially joined to a soils polygon. This left me with many duplicate soil types in each row of the landcover polygon. I would like to summarize the soil types to only show a list of unique string values. How would I go about doing this in the field calculator?

I would like to remove duplicate soil types in each cell

1
  • 1
    This isn't really a field calculator task. There are much better ways to do this, but the particulars vary by GIS platform. Please Edit the question to specify your platform.
    – Vince
    Commented Jan 21, 2022 at 21:33

1 Answer 1

0

With Field calculator and python parser:

Convert the string to a list with split

Convert the list to a set, which cant have duplicates

Join the set into a string

def nodups(soilnames):
    return ', '.join(set(soilnames.split(', ')))

Call with:

nodups(!Soil Names!)
2

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.