线性方向平均值 (空间统计)

摘要

识别一组线的平均方向、长度和地理中心。

了解有关“线性方向平均值”工作原理的详细信息

插图

Linear Directional Mean illustration

用法

语法

DirectionalMean_stats (Input_Feature_Class, Output_Feature_Class, Orientation_Only, {Case_Field})
参数说明数据类型
Input_Feature_Class

包含将进行平均方向计算的矢量的要素类。

Feature Layer
Output_Feature_Class

将包含用于表示输入要素类的平均方向的要素的线要素类。

Feature Class
Orientation_Only
  • 方向将忽略起始结点和终止结点信息。
  • ORIENTATION_ONLY将在计算平均值时使用起始结点和终止结点(默认)。
Boolean
Case_Field
(可选)

用于对要素进行分组以独立计算方向平均值的字段。案例分组字段可以为整型、日期型或字符串型。

Field

代码示例

LinearDirectionalMean 示例(Python 窗口)

以下 Python 窗口脚本演示了如何使用 LinearDirectionalMean 工具。

import arcpy
arcpy.env.workspace = r"C:\data"
arcpy.DirectionalMean_stats("AutoTheft_links.shp", "auto_theft_LDM.shp", "DIRECTION", "#")
LinearDirectionalMean 示例(独立 Python 脚本)

以下独立 python 脚本演示了如何使用 LinearDirectionalMean 工具。

# Measure the geographic distribution of auto thefts
 
# Import system modules
import arcpy
 
# Local variables...
workspace = "C:/data"
locations = "AutoTheft.shp"
links = "AutoTheft_links.shp"
standardDistance = "auto_theft_SD.shp"
stardardEllipse = "auto_theft_SE.shp"
linearDirectMean = "auto_theft_LDM.shp"
 
try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    arcpy.env.workspace = workspace
 
    # Process: Standard Distance of auto theft locations...
    arcpy.StandardDistance_stats(locations, standardDistance, "1_STANDARD_DEVIATION", "#", "#")
 
    # Process: Directional Distribution (Standard Deviational Ellipse) of auto theft locations...
    arcpy.DirectionalDistribution_stats(locations, standardEllipse, "1_STANDARD_DEVIATION", "#", "#")
 
    # Process: Linear Directional Mean of auto thefts...
    arcpy.DirectionalMean_stats(links, linearDirectMean, "DIRECTION", "#")
 
except:
    # If an error occurred while running a tool, print the messages 
    print arcpy.GetMessages()

环境

输出坐标系

进行分析之前将要素几何投影到输出坐标系。

相关主题


7/10/2012