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

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

Array

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

描述

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

语法

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

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

Object

属性

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

数组的元素计数。

Integer

方法概述

方法说明
add (value)

将 Point 或 Array 对象添加到数组的结尾处。

append (value)

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

clone (point_object)

克隆 Point 对象。

extend (items)

通过追加元素扩展数组。

getObject (index)

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

getObject 方法等同于建立对象索引;即 obj.getObject(0) 等同于 obj[0]。

insert (index, value)

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

next ()

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

remove (index)

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

removeAll ()

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

replace (index, value)

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

reset ()

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

方法

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

Either a Point or Array object can be appended to the array.

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

Either a Point or Array object can be appended to the array.

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

A Point object.

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

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

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

The index position of the array.

Integer

返回值

数据类型说明
Object

索引位置上的 Array 或 Point 对象。

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

The index position of the Array object.

Integer
value

The Point or Array object to be inserted.

Object
next ()

返回值

数据类型说明
Object

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

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

将被移除的索引位置。

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

The index position that will be replaced.

Integer
value

The new Point or Array object to be added to the Array object.

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
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

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