Set Raster Properties (Data Management)

Summary

Sets the data type, statistics, and NoData values on a raster or mosaic dataset.

Usage

  • You can define the statistics for a raster or mosaic dataset using this tool. Typically, you use this tool if you do not want statistics calculated. You can set the minimum, maximum, standard deviation, and mean values for each band. These statistics can be read from an .xml file.

  • The properties that can be set with this tool determine the default rendering settings in ArcGIS Pro, as well as statistics that are used by other tools.

    You can set the following properties:

    • Data Source Type—Define whether the cell values represent elevation or categorical data, or whether the values have been processed by other methods and do not require stretching when displaying the data.
    • Statistics Per Band—For each band, define the minimum, maximum, mean, and standard deviation values.
    • Bands for NoData Value—For each band, define a NoData value.

Parameters

LabelExplanationData Type
Input Raster

The raster or mosaic dataset with the properties to be set.

Mosaic Layer ; Raster Layer
Data Source Type
(Optional)

Specifies the type of imagery in the mosaic dataset.

  • Generic The mosaic dataset does not have a specified data type.
  • Elevation The mosaic dataset contains elevation data.
  • ThematicThe mosaic dataset has thematic data, which has discrete values, such as land cover.
  • ProcessedThe mosaic dataset has been color balanced.
  • ScientificThe data has scientific information and will be displayed with the blue to red color ramp by default.
  • Vector UVThe data is a two-band raster that contains a U and a V component of vector field data.
  • Magnitude and DirectionThe data is a two-band raster that contains the magnitude and direction of vector field data.
  • DateThe data has date information and will be displayed in date format.
String
Statistics Per Band
(Optional)

The bands and values for the minimum, maximum, mean, and standard deviation.

Value Table
Import Statistics From File
(Optional)

An .xml file that contains the statistics.

File
Bands for NoData Value
(Optional)

The NoData value for each band. Each band can have a unique NoData value defined, or the same value can be specified for all bands.

Click the NoData drop-down arrow, choose a band from the list, and click the Add button to add the band to the table. Then enter a value or multiple values. If you choose multiple NoData values, separate each value with a space.

Value Table
Key Properties
(Optional)

The natively supported properties. The data used may have additional properties not included in the following list. The properties are not case sensitive.

  • AcquisitionDate
  • BandName
  • BlockName
  • CloudCover
  • DatasetTag
  • Dimensions
  • FlowDirection
  • Footprint
  • HighCellSize
  • LowCellSize
  • MinCellSize
  • MaxCellSize
  • OffNadir
  • ParentRasterType
  • ParentTemplate
  • PerspectiveX
  • PerspectiveY
  • PerspectiveZ
  • ProductName
  • RadianceBias
  • RadianceGain
  • ReflectanceBias
  • ReflectanceGain
  • Segmented
  • SensorAzimuth
  • SensorElevation
  • SensorName
  • SolarIrradiance
  • SourceBandIndex
  • StdPressure
  • StdPressure_Max
  • StdTemperature
  • StdTemperature_Max
  • StdTime
  • StdTime_Max
  • StdZ
  • StdZ_max
  • SunAzimuth
  • SunElevation
  • ThermalConstant_K1
  • ThermalConstant_K2
  • Variable
  • VerticalAccuracy
  • WavelengthMin
  • WavelengthMax
Value Table
Multidimensional information
(Optional)

The dimensional information for the raster dataset. Setting dimensional information will convert the dimensionless raster into a multidimensional raster.

If the dimension is time, the dimension name must be StdTime. The format for time is either year-month-day (2021-10-01) or year-month-dayThh:mm:ss (2021-10-01T01:00:00).

To define a variable with both time and elevation, add the variable with time first; then add the same variable with the z-dimension.

Value Table

Derived Output

LabelExplanationData Type
Updated Raster Dataset

The output raster dataset.

Raster Dataset

arcpy.management.SetRasterProperties(in_raster, {data_type}, {statistics}, {stats_file}, {nodata}, {key_properties}, {multidimensional_info})
NameExplanationData Type
in_raster

The raster or mosaic dataset with the properties to be set.

Mosaic Layer ; Raster Layer
data_type
(Optional)

Specifies the type of imagery in the mosaic dataset.

  • GENERIC The mosaic dataset does not have a specified data type.
  • ELEVATION The mosaic dataset contains elevation data.
  • THEMATICThe mosaic dataset has thematic data, which has discrete values, such as land cover.
  • PROCESSEDThe mosaic dataset has been color balanced.
  • SCIENTIFICThe data has scientific information and will be displayed with the blue to red color ramp by default.
  • VECTOR_UVThe data is a two-band raster that contains a U and a V component of vector field data.
  • VECTOR_MAGDIRThe data is a two-band raster that contains the magnitude and direction of vector field data.
  • DATEThe data has date information and will be displayed in date format.
String
statistics
[[band_index, min, max, mean, std_dev],...]
(Optional)

The bands and values for the minimum, maximum, mean, and standard deviation.

Value Table
stats_file
(Optional)

An .xml file that contains the statistics.

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

The NoData value for each band. Each band can have a unique NoData value defined, or the same value can be specified for all bands. To define multiple NoData values for each band selection, use a space delimiter between each NoData value.

Value Table
key_properties
[key_properties,...]
(Optional)

The natively supported properties. The data used may have additional properties not included in the following list. The properties are not case sensitive.

  • AcquisitionDate
  • BandName
  • BlockName
  • CloudCover
  • DatasetTag
  • Dimensions
  • FlowDirection
  • Footprint
  • HighCellSize
  • LowCellSize
  • MinCellSize
  • MaxCellSize
  • OffNadir
  • ParentRasterType
  • ParentTemplate
  • PerspectiveX
  • PerspectiveY
  • PerspectiveZ
  • ProductName
  • RadianceBias
  • RadianceGain
  • ReflectanceBias
  • ReflectanceGain
  • Segmented
  • SensorAzimuth
  • SensorElevation
  • SensorName
  • SolarIrradiance
  • SourceBandIndex
  • StdPressure
  • StdPressure_Max
  • StdTemperature
  • StdTemperature_Max
  • StdTime
  • StdTime_Max
  • StdZ
  • StdZ_max
  • SunAzimuth
  • SunElevation
  • ThermalConstant_K1
  • ThermalConstant_K2
  • Variable
  • VerticalAccuracy
  • WavelengthMin
  • WavelengthMax
Value Table
multidimensional_info
[multidimensional_info,...]
(Optional)

The dimensional information for the raster dataset. Setting dimensional information will convert the dimensionless raster into a multidimensional raster.

If the dimension is time, the dimension name must be StdTime. The format for time is either year-month-day (2021-10-01) or year-month-dayThh:mm:ss (2021-10-01T01:00:00).

To define a variable with both time and elevation, add the variable with time first; then add the same variable with the z-dimension.

Value Table

Derived Output

NameExplanationData Type
out_raster

The output raster dataset.

Raster Dataset

Code sample

SetRasterProperties example 1 (Python window)

This is a Python sample for the SetRasterProperties function.

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 the SetRasterProperties function.

#Set raster dataset type and statistics

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

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes