Hi,
I've been away from using ArcGIS for over a year, so now I struggle to remember how to do a very simple action in the software.
I have a shape file with a number of different polygon groups that I want to reclassify into new general polygon groups.
For example, I have polygons classified as "deciduous forest", and other polygons classified as "coniferous forest". I want to reclassify them both to just be "forest" polygons. Since the Reclassify tool only works on raster data sets I am a little bit at a loss. I've done this reclassification a lot in the past, but now I can't remember how I did it.
Thank you for any help.
Solved! Go to Solution.
the easiest thing to do would be to create a new field to hold the new classification, then do a selection to select all the features you want to attribute differently, then do a field calculation into the new field with the updated classification value.
the easiest thing to do would be to create a new field to hold the new classification, then do a selection to select all the features you want to attribute differently, then do a field calculation into the new field with the updated classification value.
I managed to get it to work, thank you!
Here's a (untested) Field Calculator code block:
def reclass(value):
lookup = {
"Coniferous": "Tree",
"Deciduous": "Tree",
"Igneous": "Rock"
}
return lookup.get(value, value)
You write something like "reclass(!my_field!)" and it'll map the inputs to the outputs as defined in the "lookup" dictionary, but leave them unchanged if it's not in the list.
Alternatively, you can load the old and new values into a table, join the tables on the common key field, then field calculate over the data. This'll let you maintain a lookup table as standard ArcGIS data instead of Python code if that works better.
@DavidSolari this looks like a pretty nice approach, I'm stealing it for to put in my file of snippets to use.