Skip to main content

RadiusVariable

汇总

通过指定分析的最大距离和点数定义可变搜索半径。如果在最大距离内无法满足点数,将使用较小点数。

讨论

使用半径对象的工具包括: 克里金法反距离权重法

语法

RadiusVariable({numberOfPoints}, {maxDistance})

名称 说明 数据类型

numberOfPoints

(可选)

numberOfPoints 是指定要用于执行插值的最邻近输入采样点数量的整数值。

(默认值为 12)

Long

maxDistance

(可选)

maxDistance 使用地图单位指定距离,以此限制对最邻近输入采样点的搜索。默认值是范围的对角线长度。

如果在指定距离内无法满足点数,将使用较小点数。

Double

属性

名称 说明 数据类型

numberOfPoints

(读取和写入)

numberOfPoints 是指定要用于执行插值的最邻近输入采样点数量的整数值。

Long

maxDistance

(读取和写入)

maxDistance 使用地图单位指定距离,以此限制对最邻近输入采样点的搜索。如果在指定距离内无法满足点数,将使用较小点数。

Double

代码示例

RadiusVariable 示例 1(Python 窗口)

演示如何创建 RadiusVariabl 类并在 Python 窗口中的克里金法工具中使用 RadiusVariabl 类。

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

通过反距离权重法插值工具使用 RadiusVariable 类计算表面。

# Name: RadiusVariable_Ex_02.py
# Description: Uses the RadiusVariable 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 Variable
numberOfPoints = 5
maxDistance = 200000
searchRadius = RadiusVariable(numberOfPoints, maxDistance)

# Run IDW
outIDWRadVar = Idw(inFeature, "elevation", 2000, 3, searchRadius)

# Save the output
outIDWRadVar.save("C:/sapyexamples/output/idwradvar")