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

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

Array

  • 摘要
  • 语法
  • 属性
  • 方法概述
  • 方法
  • 代码示例

摘要

数组对象中可包含点和数组,它用于构造几何对象。

语法

 Array  ({items})
参数说明数据类型
items

项目可以包含列表、点对象或另一个数组对象。

Object

属性

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

The element count of the array.

Integer

方法概述

方法说明
add (value)

将点或数组对象添加到数组的结尾处

append (value)

在数组中的最后一个位置追加一个对象。

clone (point_object)

克隆点对象。

extend (items)

通过追加元素扩展数组。

getObject (index)

返回数组中给定索引位置上的对象。

insert (index, value)

在数组中的指定索引处添加一个对象。

next ()

返回当前索引中的下一个对象。

remove (index)

从数组中的指定索引位置移除对象。

removeAll ()

移除所有值并创建一个空对象。

replace (index, value)

替换数组中指定索引位置上的对象。

reset ()

将当前枚举索引(由 next 方法使用)设置回第一个元素。

方法

add (value)
参数说明数据类型
value

点或数组对象均可以追加至该数组。

Object
append (value)
参数说明数据类型
value

点或数组对象均可以追加至该数组。

Object
clone (point_object)
参数说明数据类型
point_object

点对象。

Point
extend (items)
参数说明数据类型
items

通过添加字符串、整数或列表扩展数组。

Object
getObject (index)
参数说明数据类型
index

数组的索引位置。

Integer

返回值

数据类型说明
Object

索引位置上的数组或点对象。

insert (index, value)
参数说明数据类型
index

数组的索引位置。

Integer
value

点或数组对象均可以插入至该数组。

Object
next ()

返回值

数据类型说明
Object

当前索引中的下一个对象。

remove (index)
参数说明数据类型
index

将被移除的索引位置。

Integer
removeAll ()
replace (index, value)
参数说明数据类型
index

将被替换的索引位置。

Integer
value

将被添加至该数组的新点或数组对象。

Object
reset ()

代码示例

数组示例

从头开始创建折线要素类。

import arcpy

# A list of features and coordinate pairs
feature_info = [[[1, 2], [2, 4], [3, 7]],
                [[6, 8], [5, 7], [7, 2], [9, 5]]]

# A list that will hold each of the Polyline objects
features = []

for feature in feature_info:
    # Create a Polyline object based on the array of points
    # Append to the list of Polyline objects
    features.append(
        arcpy.Polyline(
            arcpy.Array([arcpy.Point(*coords) for coords in feature])))

# Persist a copy of the Polyline objects using CopyFeatures
arcpy.CopyFeatures_management(features, "c:/geometry/polylines.shp")

相关主题

  • Point
  • PointGeometry
  • Polygon
  • Polyline
  • Multipoint
  • Geometry
  • 读取几何
  • 写入几何
  • 将几何对象与地理处理工具配合使用

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

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

关于 Esri

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