Skip to main content

NbrCircle

サマリー

Defines a circle neighborhood which is created by specifying the radius in either map units or number of cells.

NbrCircle neighborhood for FocalStatistics function

NbrCircle neighborhood example for the FocalStatistics function (radius = 2 cells).

NbrCircle neighborhood for BlockStatistics function

NbrCircle neighborhood example for the BlockStatistics function (radius = 3 cells).

ディスカッション

Tools that use neighborhood circle object: Block Statistics, Focal Statistics, Point Statistics, Point Density, Top Hat Transform, and Topographic Position Index.

ライセンス:

This class is also available if you have an Image Analyst extension license, but only for the Focal Statistics tool.

A circle neighborhood is created by specifying a radius value. The radius is identified in cell or map units, measured perpendicular to the x- or y-axis. When the radius is specified in map units, it is converted to a radius in cell units. The resulting radius in cell units produces an area that most closely represents the area calculated by using the original radius in map units. Any cell center encompassed by the circle will be included in the processing of the neighborhood.

構文

NbrCircle({radius}, {units})

名前 説明 データ タイプ

radius

(オプション)

The radius of the circle neighborhood.

The default value is 3.

Double

units

(オプション)

Defines the units of the neighborhood.

  • CELL—The unit of measurement is in cells.

  • MAP—The units are in map coordinates.

The default value is CELL.

String

プロパティ

名前 説明 データ タイプ

radius

(読み取り/書き込み)

The radius of the circle neighborhood.

Double

units

(読み取り/書き込み)

Defines the units of the neighborhood.

  • CELL—The units are the number of cells.

  • MAP—The units are in map coordinates.

String

コードのサンプル

NbrCircle example 1 (Python window)

Demonstrates how to create a NbrCircle class and use it in the BlockStatistics tool within the Python window.

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 example 2 (stand-alone script)

Implements the BlockStatistics tool using the NbrCircle class.

# Name: NbrCircle_Ex_02.py
# Description: Uses the NbrCircle object to run 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
radius = 2
myNbrCirc = NbrCircle(radius, "MAP")

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

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