I am working on creating a map of total chemical inputs into a study area. I have several raster layers of different inputs with values stored in the attribute tables. I am having a hard time figuring out how to add these inputs together. Is there a way in the raster calculator to add a specific field from the attribute table of each raster (these values are all decimals) and to ultimately display total chemical inputs spatially?

** I am using ArcGIS 10.3 with spatial analyst. **

  • Why are you using an attribute table? What data is stored in it? You might also want to specify what software/version you are using. – BruceDoh Jul 14 '15 at 19:34
  • The data in the table is values of fertilizer in Kg/ha. The raster is a crop data layer and the values of nitrogen vary depending on the type of crop. The other rasters are different types of similar inputs with Kg/ha values stored as attributes. – nitro34 Jul 14 '15 at 19:41
  • OK, so just to make sure I understand, the raster is classified crop data where each raster value is accompanied in the attribute table by a Kg/ha value? Eg. Field 1 is crop type, field 2 is the nitrogen concentration associated with that crop type? – BruceDoh Jul 14 '15 at 19:47
  • Basically yes. and I have a series of these raster layers each with a similar concentration values in their attribute tables and I would like to add those concentrations from all the layers to determine the spatial distribution of all these inputs. – nitro34 Jul 14 '15 at 19:51
  • What software? Do you have access to ArcGIS + spatial analyst? Please update your question with this relevant information. – BruceDoh Jul 14 '15 at 19:54

One possible solution I can think of would be to use the reclass by table tool in the spatial analyst extension to reclassify your rasters to show concentrations instead of crop data.

Eg. (using python) ReclassByTable(in_raster, attribute_table, crop_type_field, crop_type_field, concentration_field)

You could then use simple map algebra or raster calculator to add the resulting rasters together.

  • The Issue I have with ReclassByTable is that the field I want to use is a float and not an integer as is required. (I have not tried within python since I've never used it before) – nitro34 Jul 14 '15 at 21:42

Use the Lookup tool/function from the Spatial Analyst->Reclass toolset in your Raster Calculator expression.

i.e using the CellStatistics tool/function to sum:

CellStatistics([Lookup("rastera", "floatfld"), Lookup("rasterb", "floatfld"), Lookup("rasterc", "floatfld")], "SUM")

i.e adding them up manually:

Lookup("rastera", "floatfld") + Lookup("rasterb", "floatfld") + Lookup("rasterc", "floatfld")
  • +1. Never thought reclass can produce floats. I even tried arcview 3, which can see joined fields, but output is still integer – FelixIP Jul 15 '15 at 5:29
  • @FelixIP while it's in the "reclass" toolset, the lookup tool is not really a reclassification, all it does is make the attributes accessible. The ArcInfo GRID/ArcGIS 8-9 equivalent is raster.attribute and the ArcView 3x equivalent is [raster . attribute].Float (the space around the "." is required, see this answer) – user2856 Jul 15 '15 at 5:41

One way of doing this is to:

  1. convert your integer rasters to polygons (do not simplify),
  2. join relevant tables of concentrations to polygon tables,
  3. convert polygons to floating rasters using concentration field
  4. Find total of rasters with decimals

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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