If any two inputs are multidimensional rasters and share one variable but with different names, uncheck the Match Multidimensional Variable geoprocessing environment (set = False in Python) before running the tool. The variables in the inputs must have at least one common dimension and one common dimensional value for this tool to process otherwise. The output will be a multidimensional raster in CRF format. If at least one of the inputs are multidimensional raster data with the same number of variables, the tool will perform the operation for all slices with the same dimension value. The maximum length of the logical expression is 4,096 characters. In order to use a that specifies the Value field by using a Map Algebra expression as the in_conditional_raster instead.įor more information, see the code samples listed below or review Build complex statements in Map Algebra. ![]() SQL reference for query expressions used in ArcGIS.See the following topics for details on creating queries: If NoData does not satisfy the expression, it does not receive the value of the input false raster it remains NoData. If no Input false raster or constant value is specified, NoData will be assigned to those cells that do not result in true from the expression. If the evaluation of the expression is nonzero, it is treated as true. If the conditional input is a multiband raster and the true or false raster input is a constant, the tool will perform the operation using the constant value for each band in the multiband input. The tool will perform the operation on each band from the conditional raster using the corresponding band from the other inputs. The number of bands in each multiband input must be the same. The output raster will also be multiband if either the true input or the optional false input is a constant. If all inputs are multiband rasters, the output will be a multiband raster. If the Input conditional raster ( in_conditional_raster in Python) is a single-band raster and either the Input true raster or constant value ( in_true_raster_or_constant In Python) raster or the optional Input false raster or constant value ( in_false_raster_or_constant In Python) raster is a constant, the output will be a single-band raster. If both the true expression and the optional false raster are integer, the output raster will be integer. If either the true raster or the optional false raster is floating point, the output raster will be floating point. CheckOutExtension ( "Spatial" ) # Execute SetNull outSetNull = SetNull ( inRaster, inFalseRaster, whereClause ) # Save the output outSetNull. 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. ![]() 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. ![]() ![]() The input conditional raster does not affect whether the output data type is integer or floating point. If no where clause is specified, the output raster will have NoData wherever the conditional raster is not 0. If the evaluation is false, the output raster will be defined by the input false raster or constant value. 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 It returns NoData if a conditional evaluation is true, and returns the value specified by another raster if it is false. 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 |