ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Set Raster Properties

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

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

Learn more about raster statistics and properties

Usage

  • This tool allows you to define the statistics for a raster or mosaic dataset. Typically, you use this tool if you do not want them calculated for you. Statistics you can set are the minimum, maximum, standard deviation, and mean values for each band. These statistics can be read from an XML file.

    This XML file can be created by exporting the statistics from another raster or mosaic dataset, as follows:

    1. In the Catalog window, right-click the raster or mosaic dataset that contains the statistics you want to export and select Properties.
    2. Scroll down to the row containing the Statistics property.
    3. Expand the Options drop-down menu in the Value column.
    4. Click Export Statistics to XML.

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

    Properties you can set include:

    • Data Source Type: this defines 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, you can define minimum, maximum, mean, and standard deviation values.
    • Bands for NoData Value: for each band, you can define a No Data value.

Syntax

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

The raster or mosaic dataset whose properties you want to set.

Mosaic Layer ; Raster Layer
data_type
(Optional)

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.
  • THEMATIC —Thematic data has discrete values, such as land cover.
  • PROCESSED —The mosaic dataset has been color balanced.
  • SCIENTIFIC —The data has scientific information, and will be displayed with the blue to red color ramp, by default.
  • VECTOR_UV —The data is a two band raster that contains a U and a V component of vector field data.
  • VECTOR_MAGDIR —The data is a two band raster that contains the magnitude and direction of vector field data.
String
statistics
[[band_index, min, max, mean, std_dev],...]
(Optional)

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

Value Table
stats_file
(Optional)

An .xml file that contains the statistics.

To create this file, export the statistics from another raster or mosaic dataset.

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

Specify 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. 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
key_properties
[key_properties,...]
(Optional)

The natively supported properties are as follows. Your data may have additional properties not included in this list. All properties are case insensitive.

  • AcquisitionDate
  • BandName
  • BlockName
  • CloudCover
  • DatasetTag
  • Dimensions
  • FlowDirection
  • Footprint
  • HighCellSize
  • LowCellSize
  • MinCellSize
  • MaxCellSize
  • OffNadir
  • ParentRasterType
  • ParentTemplate
  • PerspectiveX
  • PerspectiveY
  • PerspectiveZ
  • ProductName
  • RadianceBias
  • RadianceGain
  • ReflectanceBias
  • RefelctanceGain
  • 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

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 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

  • Current Workspace
  • Scratch Workspace

Licensing information

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

Related topics

  • Raster data statistics
  • Calculating statistics using geoprocessing tools

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal