# NbrCircle (arcpy.sa)

## 插图

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

## 语法

 参数 说明 数据类型 radius The radius of the circle neighborhood. (默认值为 3) 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 of the circle neighborhood. Double units(读写) Defines the units of the neighborhood. String

## 代码实例

NbrCircle 示例 1（Python 窗口）

``````import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outNbrC = BlockStatistics("block", NbrCircle(2, "MAP"))
outNbrC.save("C:/sapyexamples/output/blstatsnbrc2")
``````
NbrCircle 示例 2（独立脚本）

``````# Name: NbrCircle_Ex_02.py
# Description: Uses the NbrCircle 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

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

# Execute BlockStatistics
outBlkStat =  BlockStatistics(inRaster, myNbrCirc, "MINIMUM", "DATA")

# Save the output
outBlkStat.save("C:/sapyexamples/output/blstat_cir3")
``````

5/10/2014