ArcGIS Desktop

  • 文档
  • 支持

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

将空间权重矩阵转换为表

  • 摘要
  • 插图
  • 用法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

摘要

将二进制空间权重矩阵文件 (.swm) 转换为表文件。

插图

Swm to DBF conversion
Swm files may be converted to .dbf tables and edited.

用法

  • 必要时,此工具可用于编辑空间权重矩阵文件:

    • 首先,使用生成空间权重矩阵或生成网络空间权重工具创建空间权重矩阵文件。
    • 然后,运行此工具将生成的空间权重矩阵文件转换为表。
    • 根据需要编辑表和修改空间关系。
    • 最后,再次使用生成空间权重矩阵工具将修改的表转换回二进制的空间权重矩阵文件格式。

语法

ConvertSpatialWeightsMatrixtoTable_stats (Input_Spatial_Weights_Matrix_File, Output_Table)
参数说明数据类型
Input_Spatial_Weights_Matrix_File

要转换的空间权重矩阵文件 (.swm) 的完整路径名。

File
Output_Table

要创建的表的完整路径名。

Table

代码示例

将空间权重矩阵转换为表示例(Python 窗口)

以下 Python 窗口脚本演示了“将空间权重矩阵转换为表”工具的使用方法。

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.ConvertSpatialWeightsMatrixtoTable_stats("euclidean6Neighs.swm","euclidean6Neighs.dbf")
将空间权重矩阵转换为表示例(独立 Python 脚本)

以下独立 Python 脚本演示了“将空间权重矩阵转换为表”工具的使用方法。

# Create a Spatial Weights Matrix based on Network Data 

# Import system modules
import arcpy

# Set property to overwrite existing output
arcpy.arcpy.overwriteOutput = True

# Local variables...
workspace = r"C:\Data\USCounties\US"

try:
    # Set the current workspace (to avoid having to specify the full path to the feature classes each time)
    arcpy.env.workspace = workspace

    # Create Spatial Weights Matrix 
    # Process: Generate Spatial Weights Matrix... 
    swm = arcpy.GenerateSpatialWeightsMatrix_stats("USCounties.shp", "MYID",
                        "euclidean6Neighs.swm",
                        "K_NEAREST_NEIGHBORS",
                        "#", "#", "#", 6) 

    # Dump Spatial Weights to Database Table
    # Process: Convert Spatial Weights Matrix to Table...       
    dbf = arcpy.ConvertSpatialWeightsMatrixtoTable_stats("euclidean6Neighs.swm",
                        "euclidean6Neighs.dbf")

    # Now you can edit the spatial weights (add, subtract and alter
    # neighbors and weights)

    # Read weights from table back into Spatial Weights Matrix format
    # Process: Generate Spatial Weights Matrix... 
    swm = arcpy.GenerateSpatialWeightsMatrix_stats("USCounties.shp", "MYID",
                        "euclidean6Neighs.swm",
                        "CONVERT_TABLE",
                        "#", "#", "#",
                        "#", "#", "#",
                        "euclidean6Neighs.dbf") 

except arcpy.ExecuteError:
    # If an error occurred when running the tool, print out the error message.
    print(arcpy.GetMessages())

环境

  • 当前工作空间
  • 临时工作空间

许可信息

  • ArcGIS Desktop Basic: 是
  • ArcGIS Desktop Standard: 是
  • ArcGIS Desktop Advanced: 是

相关主题

  • “实用工具”工具集概述
  • 生成空间权重矩阵
  • 生成网络空间权重
  • 空间关系建模
  • 空间自相关 (Global Moran's I)
  • 高/低聚类(Getis-Ord General G)
  • 聚类和异常值分析 (Anselin Local Moran's I)
  • 热点分析 (Getis-Ord Gi*)

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2018 Esri. | 隐私政策 | 法律声明