Skip to main content

RadiusFixed

汇总

通过指定距离和分析所需的最小点数来定义固定搜索半径。 如果在指定距离内未找到所需点数,则将增大搜索半径,直至找到指定最小点数为止。

讨论

使用半径对象的工具包括: 克里金法IDW

语法

RadiusFixed({distance}, {minNumberOfPoints})

名称 说明 数据类型

distance

(可选)

距离 可指定用作半径的距离,在该半径范围内的输入采样点将用于执行插值。半径值使用地图单位来表示。默认半径是输出栅格像元大小的五倍。

Double

minNumberOfPoints

(可选)

minNumberofPoints 是定义用于执行插值的最小点数的整数。

如果在指定距离内没有找到所需点数,则将增加搜索距离,直至找到指定的最小点数。

搜索半径需要增加时就会增加,直到 minNumberOfPoints 在该半径范围内,或者半径的范围越过输出栅格的下部(南)和/或上部(北)范围为止。NoData 会分配给不满足以上条件的所有位置。

(默认值为 0)

Long

属性

名称 说明 数据类型

distance

(读取和写入)

以地图单位指定的将用于执行插值的指定半径内的所有输入采样点的距离。

Double

minNumberOfPoints

(读取和写入)

{minNumberofPoints} 是定义用于插值的最小点数的整数。如果在指定距离内没有找到所需点数,则将增加搜索距离,直至找到指定的最小点数。

Long

代码示例

RadiusFixed 示例 1(Python 窗口)

演示如何创建 RadiusFixed 类以及如何在 Python 窗口的 克里金法 工具中使用该类。

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myRadius = RadiusFixed(80000)
outKriging = Kriging("ca_ozone_pts.shp", "ELEVATION", "SPHERICAL", "", myRadius)
outKriging.save("C:/sapyexamples/output/krigradfix")
RadiusFixed 示例 2(独立脚本)

借助 RadiusFixed 类,使用 IDW 插值工具计算表面。

# Name: RadiusFixed_Ex_02.py
# Description: Uses the RadiusFixed object to run IDW 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
inFeature = "ca_ozone_pts.shp"

# Create the Radius Object
distance = 15000
minNumPoints = 3
searchRadius = RadiusFixed(distance, minNumPoints)

# Run IDW
outRadFix = Idw(inFeature, "elevation", 2000, 2, searchRadius)

# Save the output
outRadFix.save("C:/sapyexamples/output/idwradfix")