计算近邻点距离 (空间统计)

许可等级:BasicStandardAdvanced

摘要

返回一组要素与指定的 N 个最邻近点(N 为输入参数)的最小、最大和平均距离。可从结果 窗口访问执行结果。

插图

Calculate Distance Band from Neighbor Count illustration

用法

语法

CalculateDistanceBand_stats (Input_Features, Neighbors, Distance_Method)
参数说明数据类型
Input_Features

用于计算距离统计值的要素类或图层。

Feature Layer
Neighbors

将要考虑的各要素的相邻点数目 (N)。此数目应为介于 1 和要素类中的要素总数之间的任意整数。各要素与其第 N 个相邻点之间的距离的列表将被编译,并且最大、最小和平均距离将被输出到“结果”窗口。

Long
Distance_Method

指定计算每个要素与邻近要素之间的距离的方式。

  • EUCLIDEAN_DISTANCE两点间的直线距离
  • MANHATTAN_DISTANCE沿垂直轴度量的两点间的距离(城市街区);计算方法是对两点的 x 和 y 坐标的差值(绝对值)求和。
String

代码实例

CalculateDistanceBandfromNeighborCount 示例(Python 窗口)

以下 Python 窗口脚本演示了 CalculateDistanceBandfromNeighborCount 工具的使用方法。

import arcpy
arcpy.env.workspace = "c:/data"
mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats("Blocks", 10, "EUCLIDEAN_DISTANCE")
CalculateDistanceBandfromNeighborCount 示例(独立 Python 脚本)

以下独立 Python 脚本演示了 CalculateDistanceBandfromNeighborCount 工具的使用方法。

# import module
import arcpy

# Set geoprocessing environment Workspace
arcpy.env.workspace = "c:/data"

# Set variables 
infc = "Blocks"
field = "POP2000"
outfc = "PopHotSpots"
neighbors = 10
 
# Run the CalculateDistanceBand tool to get a distance for use with the Hot Spot tool from the tool result object
mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats(infc, neighbors, "EUCLIDEAN_DISTANCE")
 
# Run the Hot Spot Analysis tool, using the maxdist output from the Calculate Distance Band tool as an input
arcpy.HotSpots_analysis(infc, field, outfc, "Fixed Distance Band", "EUCLIDEAN_DISTANCE", "None", maxdist)

环境

输出坐标系

进行分析之前,将要素几何投影到“输出坐标系”。所有数学计算都基于“输出坐标系”空间参考进行。

相关主题

许可信息

ArcGIS for Desktop Basic:是
ArcGIS for Desktop Standard:是
ArcGIS for Desktop Advanced:是
9/15/2013