Set Raster Properties (Data Management)

License Level:BasicStandardAdvanced

Summary

Sets some properties on a raster dataset or mosaic dataset, such as data type, statistics, and nodata values.

Learn more about raster statistics and properties

Usage

Syntax

SetRasterProperties_management (in_raster, {data_type}, {statistics}, {stats_file}, {nodata})
ParameterExplanationData Type
in_raster

The input raster dataset or mosaic dataset.

Mosaic Layer ; Raster Layer
data_type
(Optional)

The type of data this dataset contains.

These settings control the symbology applied when these datasets are rendered.

  • GENERICThis is a raster that does not fit any other data source type. ArcGIS will try to use the most appropriate renderer to display this data.
  • ELEVATIONThe data is elevation data. A minimum-maximum stretch will be applied when displaying this data.
  • THEMATICThe data is categorical; therefore, no stretching will be used. This data should probably be displayed with the colormap or the unique value renderer.
  • PROCESSEDThe data has already been enhanced; therefore, no stretch will be applied when displaying this dataset.
String
statistics
[[band_index, min, max, mean, std_dev],...]
(Optional)

Enter the band number, minimum statistics value, maximum statistics value, mean statistics value, and standard deviation value.

Value Table
stats_file
(Optional)

An XML file that contains the statistics. This file can be created by exporting the statistics from another raster or mosaic dataset.

File
nodata
[[band index, nodata_value],...]
(Optional)

Define values for each or all bands. Each band can have a unique NoData value defined, or the same value can be specified for all bands. If you want to define multiple NoData values for each band selection, use a space delimiter between each NoData value within the bands_for_nodata_value parameter.

Value Table

Code Sample

SetRasterProperties example 1 (Python window)

This is a Python sample for SetRasterProperties.

import arcpy
arcpy.SetRasterProperties_management("\\cpu\data\srtm.tif", "ELEVATION", 
                                     "1 50 400 5 28" , "#" , "#")
SetRasterProperties example 2 (stand-alone script)

This is a Python script sample for SetRasterProperties.

#Set raster dataset type and statistics

import arcpy
arcpy.env.workspace = "C:/Workspace"
    
arcpy.SetRasterProperties_management("srtmraster.tif", "ELEVATION", 
                                         "1 50 400 5 28", "#", "#")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
5/7/2015