So here's the problem. I have two rasters containing bathymetry data: one containing the bathymetry of the sea floor, we'll call this raster1, and another containing the difference between two previous scans of the same area, we'll call this raster2. I have to query raster2 such that any areas where the value is >10% of raster1's value will be highlighted. I tried to do this through the Extract by Attribute in ArcGIS but could not figure out the SQL statement. Any ideas on what the SQL query would look like?


1 Answer 1


I would use a Con() statement in Raster Calculator. Something such as:

Con("raster2" / "raster1" > 0.1, 1, 0)

This will generate a new raster where values of 1 represent areas where raster2 is > 10% of raster1, and values of 0 is <10%

  • 1
    +1. But given that division by zero can cause problems and that "raster2" likely contains negative as well as positive values, abs("raster2") > 0.1 * "raster1" is more advisable--and notice that con is unnecessary.
    – whuber
    Jul 27, 2015 at 20:48
  • @whuber Good point.
    – Barbarossa
    Jul 27, 2015 at 20:50
  • @whuber, I've got another question about this. I used your expression in raster calculator and it worked great, but do you know how I could use it in a script? I attempted to just use the same expression using the math toolset but the output raster only shows the "0" values.
    – purelyp93
    Aug 10, 2015 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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