Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got a vector dataset (in fact, OS MasterMap data) and I want to set the value of a certain field based on the value of another field. For example:

Field1        Field2
Building      20
Grass         50
Water         19

In the above, I want to set the value of Field2 based on the value in Field1, that is - all records that have Building in Field1 should have Field2 set to the value of 20.

I know I can do this by doing Select by Attribute and then using the Field Calculator to give the selected records a value, but doing this loads of times is going to get very boring. Is there a way to give ArcGIS a sort of table of values like you do in the Raster Reclass tool, and get it to do it automatically?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Yes. The following technique is general and works in all relational databases and (therefore) in many GISes.

Create a lookup table describing the reclassification: it will look exactly like the table in the question. Joining the lookup table to your attribute table on [Field1] completes the job.

This solution is fully automatic: any update to the attribute table or the lookup table will be immediately reflected in the join.

If you need to make the result permanent (e.g., for use in other software), use the Field Calculator simply to copy the value of [Field2] into a new field created for that purpose. This, of course, is not automatic at all and would have to be repeated whenever a value of [Field1] is changed, or [Field2] is updated in the lookup table, or records are added to the attribute table.

BTW, this used to be a great way to reclassify integer (categorical) grids in Spatial Analyst, but in recent versions, joins to grid tables do not seem to work correctly. Anyone with a positive experience in this regard please correct me (maybe the situation has improved at version 10.0?).

share|improve this answer

The online help for Arcmap 10 shows some field calculation examples using Python code blocks, to reclass data. If you didn't have to many cases, the example could provide some guidance. See the section called Calculate fields using logic with Python and Classify based on field values near the middle of the link.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.