ARCHIVED: In ArcGIS, how do I convert a shapefile to a raster using a numeric field in the vector data attribute table?
Raster grids in ArcGIS need to use integer or floating-point values for the "Value" attribute in the raster attribute table. Thus, you cannot use a text field in a vector attribute table for the cell assignment in converting vector data to raster data. If you have a small set of different text field values, an easy way around this vector-raster conversion limitation is to add a new field to the vector data that is a numeric field with a unique numeric value for each unique text field value. For example, if you have a vector dataset with a test attribute and the only field values are "banana" and "mango", you can add a new integer field to this table where each feature/record has a value of 1 for "banana" and 2 for "mango".
To do this in ArcGIS:
- Add a field to the vector attribute table; see Fundamentals of adding and deleting fields from ArcGIS Help 10.2. Recode the values for this new field according to the values in the text field.
- In ArcMap, open the attribute table for the vector dataset. From the menu, choose , and then right-click the top header record with the field name for the new integer field. Select .
- In the dialog box that opens, you can set the value for the new
field for all the records you currently have selected. For example, enter
1
for "banana" in the dialog box. - Proceed in this manner until you have recoded the new integer field for all records. If you have only two unique text field values, you can open the menu and select to swap the selected sets. If you have more than two unique text field values, you must select each one using the method.
- Once you have recoded all the records, you can use this new
integer text field for the "Features to Raster" conversion in the
Spatial Analyst
toolbar; see An overview of the To Raster toolset from ArcGIS Help 10.1.
Related documents
This is document andd in the Knowledge Base.
Last modified on 2023-05-09 14:40:12.