Arcmap raster calculator nodata12/2/2023 CheckOutExtension ( "Spatial" ) # Execute SetNull outSetNull = SetNull ( inRaster, inFalseRaster, whereClause ) # Save the output outSetNull. Failing to do so converts the 65535 to a float number which then I cannot select as no data in symbology as you can see in the atached document. workspace = "C:/sapyexamples/data" # Set local variables inRaster = "landclass" inFalseRaster = 1 whereClause = "VALUE 7" # Check out the ArcGIS Spatial Analyst extension license arcpy. # Requirements: Spatial Analyst Extension # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env. # Name: SetNull_Ex_02.py # Description: Returns NoData if a conditional evaluation is # true and returns the value specified by another # raster if it is false, on a cell-by-cell basis. SQL reference for query expressions used in ArcGIS.See the following topics for more details on creating queries in the Query Builder: If it contains all integer values, the output will be an integer raster. If the input false raster (or constant value) contains floating-point values, the output raster will be floating point. To set negative values to a uniform value, Con('elev' < 0, 0, 'elev') Or, to set negative values to NoData. This can easily be accomplished in the raster calculator using a Con or SetNull. Removing data is different than recoding it. The input conditional raster does not affect whether the output data type is integer or floating point. You did not state if you wanted to set these values to a uniform value (eg., 0) or to NoData. If no where clause is specified, the output raster will have NoData wherever the conditional raster is not 0. This would probably easier since you have a lot of areas dont overlap. You can see where wbnnear class 3 matches svonear for 4567 cells, so that become the basis for the reclass. If the evaluation is false, the output raster will be defined by the input false raster or constant value. Anyway, I used the Combine tool to come up with a raster that you can reclassify. If the evaluation of the where clause is true, the cell location on the output raster will be assigned NoData. Learn more about setting cell values to NoData with Set Null Illustration OutRas = SetNull(InRas1, InRas2, "Value = 4") Usage In Raster Calculator, input the following syntax: Con(IsNull('raster'), FocalStatistics('raster', NbrRectangle(5,5, 'CELL'), 'MEAN'), 'raster') Note: The size of the rectangle in the FocalStatistics request can be edited to meet the needs of. It returns NoData if a conditional evaluation is true, and returns the value specified by another raster if it is false. In ArcMap, navigate to ArcToolbox > Spatial Analyst Tools > Map Algebra and open the Raster Calculator. Set Null sets identified cell locations to NoData based on a specified criteria.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |