2

Using ArcGIS 10.2, I am trying to combine two rasters which are identically overlapping in shape and extent, but with different values and counts.

As an end result I would like each cell to retain values from both rasters, so I can compare the two values within each cell.

Does anyone have an idea of how to accomplish this?


I still haven't been able to accomplish my goal. let me clarify. My end goal is to have a table that does a cell by cell comparison, such as:

Value 1: 2, 5, 7

Value 2: 3, 3, 9

Difference: -1, 2, -2

I have spatial analyst, and I have been able to find the difference, but am unable to compare the differences to the original values because the object ID is based on values not individual cells.


I was able to accomplish my goal, by converting the rasters to polygons and doing a spatial join. I realize my question was misleading by inferring I needed a raster to store the data.

  • 2
    I think we need a bit more detail about what you want. When you say combine, do you mean add them, subtract them, some other operation? Have you looked at Map Algebra in the Spatial Analyst Extension? Also, are you looking to create a third raster? How would you like to retain the values from the original rasters? As attributes? – Fezter Sep 4 '14 at 22:33
  • 2
    Have you looked into the Composite Bands tool? resources.arcgis.com/en/help/main/10.1/index.html#//… – Aaron Sep 4 '14 at 23:19
  • 3
    A raster can only have one value for each cell. If you want to have two values for 1 cell in a raster you need to have multiple bands. – khafen Sep 4 '14 at 23:24
  • 1
    See if combine in Spatial Analyst is what you are after help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//…. Providing you have 2 integer rasters, the output is integer raster storing every possible combination of originals. Table of that 3rd raster however retains RasterA and RasterB values – FelixIP Sep 5 '14 at 1:08
  • Could you please explain what the entries in your table mean? For a "cell-by-cell comparison" I would expect the rows in the table to correspond to ordered pairs of cell values and the columns to give (a) the count of each ordered pair in the combined raster and (b) the two values and their difference, but your table has no clear connection to such information. Is it perhaps the transpose of the table I describe--so that pixels correspond to columns--but without any count information? (Note that a relational database table with one field for each pixel would almost surely be too unwieldy.) – whuber Sep 19 '14 at 15:45
1

raster can only store one key value per band(contrary to vectors), even if look up tables are accepted in some cases.

If you want to make comparison between your two raster, you can use the raster calculator or any other spatial analyst tool (small list here), and there is no advantage to stack the bands together.

For visualization, my little trick for integer images is to make the sum of one raster and a product of the second raster. For instance, if your largest possible value is 999, you can do :

"raster1" + 1000 * "raster2"

in the field calculator. For the visualization of floating point raster of continuous values, you can then stack your bands in a multiband raster (composite band), and assign the red color to band 1, then the green and blue to band 2.

As a remark, working with rasters in ArcGIS requires the spatial analyst extension. If you don't have it, you need to either use another software (e.g. QGIS, gdal_calc otbgui_BandMath ) or convert your raster to polygon.

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.