Skip To Content

Get Raster Properties

Summary

Retrieves information from the metadata and descriptive statistics about a raster dataset.

Usage

  • The property value returned is displayed in the Geoprocessing history item created by running the tool.

  • The Python result of this tool is a geoprocessing Result object. In order to obtain the string value, use the Result object's getOutput method.

Syntax

GetRasterProperties_management (in_raster, {property_type}, {band_index})
ParameterExplanationData Type
in_raster

The raster containing the properties to retrieve.

Composite Geodataset
property_type
(Optional)

The property to be obtained from the input raster.

  • MINIMUMSmallest value of all cells in the input raster.
  • MAXIMUMLargest value of all cells in the input raster.
  • MEANAverage of all cells in the input raster.
  • STDStandard deviation of all cells in the input raster.
  • UNIQUEVALUECOUNTNumber of unique values in the input raster.
  • TOPTop or YMax value of the extent.
  • LEFTLeft or XMin value of the extent.
  • RIGHTRight or XMax value of the extent.
  • BOTTOMBottom or YMin value of the extent.
  • CELLSIZEXCell size in the x-direction.
  • CELLSIZEYCell size in the y-direction.
  • VALUETYPEType of the cell value in the input raster:
    • 0 = 1-bit
    • 1 = 2-bit
    • 2 = 4-bit
    • 3 = 8-bit unsigned integer
    • 4 = 8-bit signed integer
    • 5 = 16-bit unsigned integer
    • 6 = 16-bit signed integer
    • 7 = 32-bit unsigned integer
    • 8 = 32-bit signed integer
    • 9 = 32-bit floating point
    • 10 = 64-bit double precision
    • 11 = 8-bit complex
    • 12 = 16-bit complex
    • 13 = 32-bit complex
    • 14 = 64-bit complex
  • COLUMNCOUNTNumber of columns in the input raster.
  • ROWCOUNTNumber of rows in the input raster.
  • BANDCOUNTNumber of bands in the input raster.
  • ANYNODATAReturns whether there is NoData in the raster.
  • ALLNODATAReturns whether all the pixels are NoData. This is the same as ISNULL.
  • SENSORNAMEName of the sensor.
  • PRODUCTNAMEProduct name related to the sensor.
  • ACQUISITIONDATEDate that the data was captured.
  • SOURCETYPESource type.
  • CLOUDCOVERAmount of cloud cover as a percentage.
  • SUNAZIMUTHSun azimuth, in degrees.
  • SUNELEVATIONSun elevation, in degrees.
  • SENSORAZIMUTHSensor azimuth, in degrees.
  • SENSORELEVATIONSensor elevation, in degrees.
  • OFFNADIROff-nadir angle, in degrees.
  • WAVELENGTHWavelength range of the band, in nanometers.
String
band_index
(Optional)

Choose the band name from which to get the properties. If no band is chosen, then the first band will be used.

String

Code sample

GetRasterProperties example 1 (Python window)

This is a Python sample for GetRasterProperties.

import arcpy
#Get the geoprocessing result object
elevSTDResult = arcpy.GetRasterProperties_management("c:/data/elevation", "STD")
#Get the elevation standard deviation value from geoprocessing result object
elevSTD = elevSTDResult.getOutput(0)
GetRasterProperties example 2 (stand-alone script)

This is a Python script sample for GetRasterProperties.

import arcpy
#Get the geoprocessing result object
elevSTDResult = arcpy.GetRasterProperties_management("c:/data/elevation", "STD")
#Get the elevation standard deviation value from geoprocessing result object
elevSTD = elevSTDResult.getOutput(0)

Environments

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes