Select to view content in your preferred language

Merging 10 vector polygon classes into 5 classes

487
4
Jump to solution
10-26-2023 08:20 AM
Labels (1)
Ugglefar
New Contributor II

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.

0 Kudos
1 Solution

Accepted Solutions
clt_cabq
Regular Contributor

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.

View solution in original post

4 Replies
clt_cabq
Regular Contributor

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.

Ugglefar
New Contributor II

I managed to get it to work, thank you!

0 Kudos
DavidSolari
Occasional Contributor III

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.

clt_cabq
Regular Contributor

@DavidSolari this looks like a pretty nice approach, I'm stealing it for to put in my file of snippets to use.

0 Kudos