RadiusVariable (arcpy.sa)

摘要

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

讨论

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

语法

RadiusVariable ({numberOfPoints}, {maxDistance})
参数说明数据类型
numberOfPoints

The numberOfPoints is an integer value specifying the number of nearest input sample points to be used to perform the interpolation.

(默认值为 12)

Long
maxDistance

The maxDistance specifies the distance, in map units, by which to limit the search for the nearest input sample points. The default value is the length of the extent's diagonal.

If the number of points cannot be satisfied within that distance, a smaller number of points will be used.

Double

属性

属性说明数据类型
numberOfPoints
(读写)

The numberOfPoints is an integer value specifying the number of nearest input sample points to be used to perform the interpolation.

Long
maxDistance
(读写)

The maxDistance specifies the distance, in map units, by which to limit the search for the nearest input sample points. If the number of points cannot be satisfied within that distance, a smaller number of points will be used.

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 execute 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)

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

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

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

相关主题

9/15/2013