ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

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

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

ArcMap

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

Index

  • 摘要
  • 讨论
  • 属性
  • 代码示例

摘要

索引对象包含有关表索引的信息。存在两种索引类型:空间与属性。空间索引存在于要素类的 shape 字段中。

讨论

无法直接创建索引对象。可通过 ListIndexes 和 Describe 功能访问索引对象。

属性

属性说明数据类型
fields
(只读)

索引字段对象的 Python 列表。

Field
isAscending
(只读)

isAscending 状态:索引按升序排序时为真。

Boolean
isUnique
(只读)

isUnique 状态:索引唯一时为真。

Boolean
name
(只读)

索引的名称。

String

代码示例

索引示例

显示指定表的索引属性。

import arcpy

feature_class = "c:/data/well.shp"

# Create a list of indexes using the ListIndexes function
indexes = arcpy.ListIndexes(feature_class)

# Iterate through the list of indexes
for index in indexes:
    # Print index properties
    print("Name: {0}".format(index.name))
    print("\tType            : {0}".format(index.isAscending))
    print("\tScale           : {0}".format(index.isUnique))
    print("\tNumber of fields: {0}".format(len(index.fields)))

相关主题

  • 使用字段和索引

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

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

关于 Esri

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