ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

Array

  • Resumen
  • Sintaxis
  • Propiedades
  • Descripción general del método
  • Métodos
  • Muestra de código

Resumen

The array object can contain points and arrays and is used to construct geometry objects.

Sintaxis

 Array  ({items})
ParámetroExplicaciónTipo de datos
items

Items can include a list, a Point object, or another Array object.

Object

Propiedades

PropiedadExplicaciónTipo de datos
count
(Sólo lectura)

The element count of the array.

Integer

Descripción general del método

MétodoExplicación
add (value)

Adds a Point or Array object to the end of the array.

append (value)

Appends an object to the array in the last position.

clone (point_object)

Clone the Point object.

extend (items)

Extends the array by appending elements.

getObject (index)

Returns the object at the given index position in the array.

The getObject method is equivalent to indexing an object; that is, obj.getObject(0) is equivalent to obj[0].

insert (index, value)

Adds an object to the Array object at the specified index.

next ()

Returns the next object at the current index.

remove (index)

Removes the object at the specified index position from the array.

removeAll ()

Removes all values and creates an empty object.

replace (index, value)

Replaces the object at the specified index position in the Array object.

reset ()

Sets the current enumeration index (used by the next method) back to the first element.

Métodos

add (value)
ParámetroExplicaciónTipo de datos
value

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

Object
append (value)
ParámetroExplicaciónTipo de datos
value

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

Object
clone (point_object)
ParámetroExplicaciónTipo de datos
point_object

A Point object.

Point
extend (items)
ParámetroExplicaciónTipo de datos
items

Extends the array by adding strings, integers, or lists.

Object
getObject (index)
ParámetroExplicaciónTipo de datos
index

The index position of the array.

Integer

Valor de retorno

Tipo de datosExplicación
Object

The Array or Point object at the index position.

insert (index, value)
ParámetroExplicaciónTipo de datos
index

The index position of the Array object.

Integer
value

The Point or Array object to be inserted.

Object
next ()

Valor de retorno

Tipo de datosExplicación
Object

The next object at the current index.

remove (index)
ParámetroExplicaciónTipo de datos
index

The index position that will be removed.

Integer
removeAll ()
replace (index, value)
ParámetroExplicaciónTipo de datos
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 ()

Muestra de código

Array example

Create a polyline feature class from scratch.

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")

Temas relacionados

  • Point
  • PointGeometry
  • Polygon
  • Polyline
  • Multipoint
  • Geometry
  • Leer geometrías
  • Escribir geometrías
  • Utilizar objetos de geometría con herramientas de geoprocesamiento

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2021 Esri. | Privacidad | Legal