


For pixels with the value 1, your condition is fulfilled/true. Con Pick Set Null Kernel Density Line Density Point Density. In the first step, IsNull gives the NoData areas a value of 1 and the non-NoData areas a value. Input false raster or constant value : InRas1. Input true raster or constant value : 100. However the Raster Calculator may also be used to call the Con and IsNull tools to perform the same task. Use Con on the results to give the original NoData areas a value: Input conditional raster : OutNullRas. You will get an output raster with the values 0 and 1. In both versions 10.x and 9.3, the Con tool can be used outside of the Raster Calculator to create a new raster with reset NoData (Null) values. We can then use that intermediate raster with the SetNull function to. This will generate a raster where pixels will have a value of 1 if any of the two input raster pixels is NoData. Start Time: Wednesday, 16 March 2022 18:28:46Ĭon(Raster(r"Presentation MCE: TWI\TWI") 0) & (Raster(r"Presentation MCE: TWI\TWI") = 1) & (Raster(r"Presentation MCE: TWI\TWI") = 2) & (Raster(r"Presentation MCE: TWI\TWI") = 3) & (Raster(r"Presentation MCE: TWI\TWI") = 4) & (Raster(r"Presentation MCE: TWI\TWI") = 5) & (Raster(r"Presentation MCE: TWI\TWI") = 6) & (Raster(r"Presentation MCE: TWI\TWI") = 7) & (Raster(r"Presentation MCE: TWI\TWI") = 8) & (Raster(r"Presentation MCE: TWI\TWI") = 9) & (Raster(r"Presentation MCE: TWI\TWI") =10, 1))ĮRROR 000539: Traceback (most recent call last):įile "", line 5, in rcexec_DC684390_0C54_4F14_9EBF_B34DF3F2E1B1įile "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\ Functions.py", line 1140, in BooleanAndįile "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\ Utils.py", line 55, in swapperįile "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\ Functions. You can make sure avoiding syntax or expression errors by double-clicking the corresponding elements in the raster calculator. I suggest then to run Raster Calculator with a function like this SetNull ( (IsNull ('raster1') IsNull ('raster2')) 1, 'raster1'). I was not sure whether your highest pint is. Under Expression, Type in Con and hit enter to enter your conditional statement. Add you DEM as the Raster Variable and assign a character to it (like x in my below image). Map Algebra expression Con("Presentation MCE: TWI\TWI" 0) & ("Presentation MCE: TWI\TWI" = 1) & ("Presentation MCE: TWI\TWI" = 2) & ("Presentation MCE: TWI\TWI" = 3) & ("Presentation MCE: TWI\TWI" = 4) & ("Presentation MCE: TWI\TWI" = 5) & ("Presentation MCE: TWI\TWI" = 6) & ("Presentation MCE: TWI\TWI" = 7) & ("Presentation MCE: TWI\TWI" = 8) & ("Presentation MCE: TWI\TWI" = 9) & ("Presentation MCE: TWI\TWI" =10, 1)) From Imagery tab, open up Raster Functions and search for Calculator. Am I missing some paranthesis or something? I counted each Con to have the same number of paranthesises. CheckOutExtension ( "Spatial" ) # Execute IsNull outIsNull = IsNull ( inRaster ) # Save the output outIsNull.
ARCMAP RASTER CALCULATOR CON PICK SETNULL LICENSE
workspace = "C:/sapyexamples/data" # Set local variables inRaster = "degs" # Check out the ArcGIS Spatial Analyst extension license arcpy. I tried using the value as well in Set Null and the Raster Calculator, no luck. Answer needs to use Raster Calculator syntax.

I do not want to go the vector conversion route. I want to maintain all the rest of the aspect values except those that equal -1 (flat).

ARCMAP RASTER CALCULATOR CON PICK SETNULL FULL
But it is not the full erase, part of the buff/slope is missing. Hi there, I was wondering if someone could help me convert all -1 to null in my aspect raster using raster calculator. Ran the function, and I still get the same result shown in image 1. and they suggested something like this (for my case block is the red raster and buff is the slope) Con (IsNull ('block.tif'),'buff.tif') this produces the output in the multi colors. # Name: IsNull_Ex_02.py # Description: Find which cell values of the input raster are NoData # Requirements: Spatial Analyst Extension # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env. Raster Calculator (image 2) Set Null (image 3) I have also gone to (Windows / image analysis), selected one of the files, added a function, and computed the 'NoData' values.
