摘要
SearchNeighborhoodSmooth 类可用于定义以下邻域搜索方法:反距离权重法、局部多项式插值法、和径向基函数插值法(仅在使用 INVERSE_MULTIQUADRIC_FUNCTION 关键字的情况下使用)。平滑搜索邻域类接受如下输入:短轴和长轴、搜索椭圆的大小、搜索椭圆的角度和平滑系数。
语法
SearchNeighborhoodSmooth ({majorSemiaxis}, {minorSemiaxis}, {angle}, {smoothFactor})
参数 | 说明 | 数据类型 |
majorSemiaxis | 以地图单位表示的距离,指定从其中选择数据的椭圆的长半轴长度。 | Double |
minorSemiaxis | 以地图单位表示的距离,指定从其中选择数据的椭圆的短半轴长度。 | Double |
angle | 搜索椭圆的角度。 | Double |
smoothFactor | 确定要执行的平滑量:0 为无平滑;1 为最大平滑量。 | Double |
属性
属性 | 说明 | 数据类型 |
angle (可读写) | 搜索椭圆的角度。 | Double |
majorSemiaxis (可读写) | 以地图单位表示的距离,指定在其中选择数据的椭圆的长半轴长度。 | Double |
minorSemiaxis (可读写) | 以地图单位表示的距离,指定在其中选择数据的椭圆的短半轴长度。 | Double |
nbrType (只读) | 邻域类型:平滑或标准。 | String |
smoothFactor (可读写) | 确定要执行的平滑量:0 为无平滑,1 为最大平滑量。 | Double |
代码示例
使用 SearchNeighborhoodSmooth 和“局部多项式插值法”来生成输出栅格。
import arcpy
arcpy.env.workspace = "C:/gapyexamples/data"
arcpy.LocalPolynomialInterpolation_ga(
"ca_ozone_pts", "OZONE", "outLPI", "C:/gapyexamples/output/lpiout", "2000",
"2", arcpy.SearchNeighborhoodSmooth(300000, 300000, 0, 0.5), "QUARTIC",
"", "", "", "", "PREDICTION")
使用 SearchNeighborhoodSmooth 和“局部多项式插值法”来生成输出栅格。
# Name: LocalPolynomialInterpolation_Example_02.py
# Description: Local Polynomial interpolation fits many polynomials, each
# within specified overlapping neighborhoods.
# Requirements: Geostatistical Analyst Extension
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:/gapyexamples/data"
# Set local variables
inPointFeatures = "ca_ozone_pts.shp"
zField = "ozone"
outLayer = "outLPI"
outRaster = "C:/gapyexamples/output/lpiout"
cellSize = 2000.0
power = 2
kernelFunction = "QUARTIC"
bandwidth = ""
useConNumber = ""
conNumber = ""
weightField = ""
outSurface = "PREDICTION"
# Set variables for search neighborhood
majSemiaxis = 300000
minSemiaxis = 300000
angle = 0
smoothFactor = 0.5
searchNeighbourhood = arcpy.SearchNeighborhoodSmooth(majSemiaxis, minSemiaxis,
angle, smoothFactor)
# Execute LocalPolynomialInterpolation
arcpy.LocalPolynomialInterpolation_ga(inPointFeatures, zField, outLayer, outRaster,
cellSize, power, searchNeighbourhood,
kernelFunction, bandwidth, useConNumber,
conNumber, weightField, outSurface)