Get Raster Properties获得栅格的信息
Summary
Returns the properties of a raster dataset.
Usage
-
The property returned will be displayed in the geoprocessing window.
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 from arcpy import env env.workspace = "c:/data" #Get the geoprocessing result object elevSTDResult = arcpy.GetRasterProperties_management("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 from arcpy import env env.workspace = "c:/data" #Get the geoprocessing result object elevSTDResult = arcpy.GetRasterProperties_management("elevation", "STD") #Get the elevation standard deviation value from geoprocessing result object elevSTD = elevSTDResult.GetOutput(0)