I have a shapefile with 10 different values (geological ages) which I want to combine into four values (into broader age categories).
Is there a tool which I can use to selectively combine values in ArcMap?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Add a new text field to the data. Enter an edit session for the data. In ArcMap open the attribute table and right-click on the field name for the new field and select Field Calculator. Choose Python as the Parser and check on Show Codeblock.
In the Pre-Logic Script Code: use the following code.
def re_age(old_age): if old_age in ["Age1", "Age2"]: return "Broader Age 1" elif old_age in ["Age3", "Age4"]: return "Broader Age 2" elif old_age in ["Age5"]: return "Broader Age 3"
You need to change what is in between the square brackets [ ] with the 10 ages you want to reclassify. Add more elif if needed. Also change the "Broader Age 1" etc to what you want the new broader group to be named.
Below the code block put in
Click in the parentheses and select your field from the Fields list by double clicking on it.
so it should look something like
Click OK. Save your edits.
Note: you can use Field Calculator outside and edit session but you cannot rollback if you make a mistake, so its good practice to use in an edit session.