Get Raster Properties (Data Management)
Summary
Returns the properties of a raster dataset.
Usage
-
The property returned will be displayed in the geoprocessing window.
The Python result of this tool always returns a geoprocessing result object. In order to obtain the actual string value, you need to get the output value result.getOutput(0). To obtain a value other than a string, then you need to cast getOutput, such as int(result.getOutput(0)). For more information, refer to Getting results from a tool..
Syntax
GetRasterProperties_management (in_raster, {property_type})
Parameter | Explanation | Data Type |
in_raster |
The input raster dataset. | Raster Layer |
property_type (Optional) |
The property to be obtained from the raster dataset.
| 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