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

NumPyArrayToFeatureClass

  • Resumen
  • Debate
  • Sintaxis
  • Muestra de código

Resumen

Convierte una matriz estructurada NumPy en una clase de entidad de punto.

Debate

Si un nombre de campo de la matriz de entrada no es válido para el formato de salida, se validará. Todos los caracteres no válidos del nombre del campo de entrada se sustituyen por un guion bajo (_) en el nombre del campo de salida. Las restricciones del nombre de campo dependen de la base de datos concreta que se utilice.

NumPyArrayToFeatureClass no sobrescribirá ninguna clase de entidad existente, ni siquiera si el entorno overwriteOutput está definido como True.

NumPy is a fundamental package for scientific computing in Python, including support for a powerful N-dimensional array object. For more information, see Working with NumPy in ArcGIS.

Sintaxis

NumPyArrayToFeatureClass (in_array, out_table, shape_fields, {spatial_reference})
ParámetroExplicaciónTipo de datos
in_array

Una matriz estructurada NumPy.

La matriz debe incluir nombres de campo y dtypes NumPy.

NumPyArray
out_table

The output point feature class to which the records from the NumPy array will be written.

String
shape_fields
[shape_fields,...]

A list (or tuple) of field names used to create the feature class' geometry. Coordinates are specified in the order of x, y, z, and m. z-coordinate and m-value fields are optional.

Assuming field names of x, y, z, and m in a numpy array, feature classes could be constructed as below.

import arcpy

# Create a feature class with x,y fields
arcpy.da.NumPyArrayToFeatureClass(array, fc, ("x", "y"))

# Create a feature class with x,y,z fields
arcpy.da.NumPyArrayToFeatureClass(array, fc, ("x", "y", "z"))

# Create a feature class with x,y,m fields
arcpy.da.NumPyArrayToFeatureClass(array, fc, ("x", "y", "", "m"))

# Create a feature class with x,y,z,m fields
arcpy.da.NumPyArrayToFeatureClass(array, fc, ("x", "y", "z", "m"))
String
spatial_reference

La referencia espacial de la clase de entidad. Se puede especificar con un objeto SpatialReference o un equivalente de cadena.

(El valor predeterminado es None)

SpatialReference

Muestra de código

import arcpy
import numpy

outFC = "C:/data/texas.gdb/fd/pointlocations"

# Create a numpy array with an id field, and a field with a tuple 
#  of x,y coordinates
#
array = numpy.array([(1, (471316.3835861763, 5000448.782036674)),
                     (2, (470402.49348005146, 5000049.216449278))],
                    numpy.dtype([('idfield',numpy.int32),('XY', '<f8', 2)]))

# Define a spatial reference for the output feature class
#
SR = arcpy.Describe("C:/data/texas.gdb/fd").spatialReference

# Export the numpy array to a feature class using the XY field to
#  represent the output point feature
#
arcpy.da.NumPyArrayToFeatureClass(array, outFC, ['XY'], SR)

Temas relacionados

  • NumPyArrayToTable
  • FeatureClassToNumPyArray
  • TableToNumPyArray
  • Trabajar con NumPy en ArcGIS
  • ExtendTable

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