Get Raster Properties (Data Management)

Summary

Returns the properties of a raster dataset.

Usage

Syntax

GetRasterProperties_management (in_raster, {property_type})
ParameterExplanationData Type
in_raster

The input raster dataset.

Raster Layer
property_type
(Optional)

The property to be obtained from the raster dataset.

  • MINIMUMReturns the smallest value of all cells in the input raster.
  • MAXIMUMReturns the largest value of all cells in the input raster.
  • MEANReturns the average of all cells in the input raster.
  • STDReturns the standard deviation of all cells in the input raster.
  • UNIQUEVALUECOUNTReturns the number of unique values in the input raster.
  • TOPReturns the top or YMax value of the extent.
  • LEFTReturns the left or XMin value of the extent.
  • RIGHTReturns the right or XMax value of the extent.
  • BOTTOMReturns the bottom or YMin value of the extent.
  • CELLSIZEXReturns the cell size in the x-direction.
  • CELLSIZEYReturns the cell size in the y-direction.
  • VALUETYPEReturns the type 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 = 64-bit complex
    • 13 = 16-bit complex
    • 14 = 32-bit complex
  • COLUMNCOUNTReturns the number of columns in the input raster.
  • ROWCOUNTReturns the number of rows in the input raster.
  • BANDCOUNTReturns the number of bands in the input raster.
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

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014