ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

NumPyArrayToFeatureClass

  • Résumé
  • Discussion
  • Syntaxe
  • Exemple de code

Résumé

Convertit un tableau structuré NumPy en une classe d'entités ponctuelles.

Discussion

Si un nom de champ du tableau en entrée n'est pas valide pour le format de sortie, il sera validé. Tous les caractères non valides du nom de champ en entrée sont remplacés par un trait de soulignement (_) dans le nom de champ en sortie. Les restrictions de nom de champ dépendent de la base de données spécifique utilisée.

La fonction NumPyArrayToFeatureClass ne remplacera pas une classe d'entités existante, même si l'environnement overwriteOutput est défini sur Vrai.

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.

Syntaxe

NumPyArrayToFeatureClass (in_array, out_table, shape_fields, {spatial_reference})
ParamètreExplicationType de données
in_array

Tableau structuré NumPy

Le tableau doit comprendre des noms de champs et des 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

Référence spatiale de la classe d’entités. Elle peut être spécifié soit avec un objet SpatialReference soit avec une chaîne équivalente.

(La valeur par défaut est None)

SpatialReference

Exemple de code

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)

Rubriques connexes

  • NumPyArrayToTable
  • FeatureClassToNumPyArray
  • TableToNumPyArray
  • Utilisation de NumPy dans ArcGIS
  • ExtendTable

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS

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

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog d’Esri
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2021 Esri. | Confidentialité | Légal