1

I've posted about this problem before but I've got a few new questions.

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 can do this in Raster Calculator in ArcGIS and using:

Abs("raster2") > 0.1 * "raster1"

Now the Raster Calculator approach works great, but I tried to incorporate this step into a larger script with these lines of code:

arcpy.CheckOutExtension("Spatial")
outFinal = Abs(outDiffMinus) > (0.1 * outIntShallow)
#The output needs to be saved as an ASCII file due to the applications of my script
arcpy.RasterToASCII_conversion(outFinal, directory)

The problem is that the script approach only shows areas that don't fit the criteria (i.e. the "0" areas in the Raster calculator approach).

Here's the output from the raster calculator: enter image description here

And here's the script's output of the same area:

enter image description here

Any thoughts on what could be wrong with my script?

asked Aug 10, 2015 at 20:36

1 Answer 1

1

Well, turns out the issue is when I converted "outFinal" to ASCII, everything got assigned as the same value, but when I saved it as a BIL, the calculation worked, as shown here:

enter image description here

So if you're raster isn't categorized right the first time around. Try saving it as a BIL or another format.

answered Aug 10, 2015 at 21:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.