Select to view content in your preferred language

Add raster fields other than value

768
4
11-05-2012 01:44 PM
NealaGriffin
Deactivated User
I have two raster datasets and would like to add the values of two fields; not the Value field.  Can anyone help me out with the proper syntax for raster calculator to add together user defined fields?  Thanks!
0 Kudos
4 Replies
MarcinGasior
Frequent Contributor
You can only add new field to raster of integer type (not floating point). It can be done in the same way as for feature class - in attribute table menu.
To check what type is your raster in Catalog window open raster properties and look for Pixel Type value.

You can convert floating point raster to integer using Int tool from spatial analyst toolset. But this operation truncates decimal part of raster values.
0 Kudos
NealaGriffin
Deactivated User
You can only add new field to raster of integer type (not floating point). It can be done in the same way as for feature class - in attribute table menu.
To check what type is your raster in Catalog window open raster properties and look for Pixel Type value.

You can convert floating point raster to integer using Int tool from spatial analyst toolset. But this operation truncates decimal part of raster values.


Thanks, but this doesn't quite answer my question.  I have two integer fields in two separate rasters and I want to create a new raster by adding the values of these two integer fields...I'm pretty sure raster calculator is what I need, but I don't know how to specify which fields to add together.  Thanks 🙂
0 Kudos
EricRice
Esri Regular Contributor
Neala,

What version are you using?  Post 10.0, you have to run the Lookup tool on the two fields to create two new rasters, then you can add them together.  The Lookup tool creates a new raster based on values in a field.

Best,
Eric
0 Kudos
RamB
by
Frequent Contributor
Hi

If you are unsure of using a lookup table. you can convert your raster to a feature, and while doing this, you can select a field to contain new values. Then again you can convert that feature polygon to a raster. It is a little back and forth process but works. The core issues that remains is that raster calculations work only on value field.



Regards,
0 Kudos