ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

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

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

ArcMap

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

将空间权重矩阵转换为表

  • 描述
  • 插图
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

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

插图

Swm 至 DBF 的转换
Swm 文件可能会转换为 .dbf 表并对其进行编辑。

使用方法

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

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

语法

arcpy.stats.ConvertSpatialWeightsMatrixtoTable(Input_Spatial_Weights_Matrix_File, Output_Table)
参数说明数据类型
Input_Spatial_Weights_Matrix_File

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

File
Output_Table

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

Table

代码示例

ConvertSpatialWeightsMatrixtoTable 示例 1(Python 窗口)

以下 Python 窗口脚本演示了如何使用 ConvertSpatialWeightsMatrixtoTable 函数。

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.ConvertSpatialWeightsMatrixtoTable_stats("euclidean6Neighs.swm", "euclidean6Neighs.dbf")
ConvertSpatialWeightsMatrixtoTable 示例 2(独立脚本)

以下独立 Python 脚本演示了如何使用 ConvertSpatialWeightsMatrixtoTable 功能。

# Create a Spatial Weights Matrix based on Network Data 
# Import system modules
import arcpy
# Set property to overwrite existing output
arcpy.env.overwriteOutput = True
# Local variables...
workspace = r"C:\Data\USCounties\US"
# 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")

环境

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

许可信息

  • Basic: 是
  • Standard: 是
  • 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
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

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