ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • ArcGIS Pro
  • ArcMap
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 for 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.

  • ArcGIS Pro
  • ArcMap
Esri
English
  • English
  • Deutsch
  • Español
  • Français
  • 日本語
  • Русский
  • 简体中文
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

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

InsertCursor

La documentación de ArcGIS 10.4 se ha archivadod y ha dejado de actualizarse. El contenido y los enlaces pueden estar obsoletos. Consulte la documentación más reciente.
  • Resumen
  • Debate
  • Sintaxis
  • Muestra de código

Resumen

Inserts rows into a feature class, shapefile, or table. The InsertCursor returns an enumeration object that hands out row objects.

Debate

New row objects can be obtained using the newRow method on the enumeration object into which rows are to be inserted. Each call to insertRow on the cursor creates a new row in the table whose initial values are set to the values in the input row.

Sintaxis

InsertCursor (dataset, {spatial_reference})
ParámetroExplicaciónTipo de datos
dataset

The table, feature class, or shapefile into which rows will be inserted.

String
spatial_reference

Coordinates are specified in the spatial_reference provided and converted on the fly to the coordinate system of the dataset.

SpatialReference

Valor de retorno

Tipo de datosExplicación
Cursor

Returns a Cursor object against the specified feature class, shapefile, or table.

Muestra de código

InsertCursor example

Inserts 25 new rows into a table.

import arcpy

# Create insert cursor for table
rows = arcpy.InsertCursor("c:/base/data.gdb/roads_lut")

# Create 25 new rows. Set the initial row ID and distance values
for x in range(1, 26):
    row = rows.newRow()
    row.setValue("rowid", x)
    row.setValue("distance", 100)
    rows.insertRow(row)

# Delete cursor and row objects to remove locks on the data
del row
del rows

Temas relacionados

  • Acceso a datos utilizando cursores
  • UpdateCursor
  • SearchCursor

ArcGIS Desktop

  • Inicio
  • ArcGIS Pro
  • ArcMap
  • Documentación
  • Soporte

ArcGIS

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

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Copyright © 2019 Esri. | Privacidad | | Legal