NbrWedge (arcpy.sa)

插图

 FocalStatistics 函数的 NbrWedge 邻域示例
 BlockStatistics 函数的 NbrWedge 邻域示例

语法

 参数 说明 数据类型 radius The radius is the distance from the corner of the wedge to the outer limit of the wedge. The radius is an integer or floating-point value. (默认值为 3) Double startAngle The startAngle is an integer or floating-point value from 0 to 360. The start angle is measured counterclockwise from the positive x-axis (3:00 on a clock) to the closest edge of the wedge. (默认值为 0) Double endAngle The endAngle is an integer or floating-point value from 0 to 360. The end angle is measured counterclockwise from the positive x-axis (3:00 on a clock) to the outer edge of the wedge. (默认值为 90) Double units Defines the units of the neighborhood. CELL —The unit of measurement is in cells. MAP —The units are in map coordinates. (默认值为 CELL) String

属性

 属性 说明 数据类型 radius(读写) The radius is the distance from the corner of the wedge to the outer limit of the wedge. The radius is an integer or floating-point value. Double startAngle(读写) The startAngle is a value from 0 to 360. It can be integer or floating-point. The start angle is measured counterclockwise from the positive x-axis (3:00 on a clock) to the closest edge of the wedge. Double endAngle(读写) The endAngle is a value ranging from 0 to 360. It can be integer or floating-point. The endAngle is measured counterclockwise from the positive x-axis (3:00 on a clock) to the outer edge of the wedge. Double units(读写) Defines the units of the neighborhood. String

代码实例

NbrWedge 示例 1（Python 窗口）

``````import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outNbrWedge = BlockStatistics("block", NbrWedge(5, 10.5, 40, "MAP"))
outNbrWedge.save("C:/sapyexamples/output/blstatsnbrw2")
``````
NbrWedge 示例 2（独立脚本）

``````# Name: NbrWedge_Ex_02.py
# Description: Uses the NbrWedge object to execute BlockStatistics tool
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inRaster = "block"

# Create the Neighborhood Object
startAngle = 5
endAngle = 10

myNbrWedge = NbrWedge(radius, startAngle, endAngle, "")

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute BlockStatistics
outBlkStats =  BlockStatistics(inRaster, myNbrWedge, "MINIMUM", "DATA")

# Save the output
outBlkStats.save("C:/sapyexamples/output/blkst_wedge4")
``````

9/15/2013