TransWikia.com

Error when using NumPyArrayToFeatureClass in ArcPy

Geographic Information Systems Asked on November 1, 2021

I am trying to write out a structured numpy array to a feature class using ArcPy, but this error message is returned:

File "<ipython-input-104-556b13ea80bd>", line 1, in
arcpy.da.NumPyArrayToFeatureClass(a,’b’,[‘SHAPE@XY’],spatRef)

Even reading a feature class into a numpy array and then try to export as a feature class generates the same error. For example, if I have a feature class ("fc") that I import into a numpy array in python, I can’t export it back as a feature class.

import arcpy
import arcpy.da as da

a = da.FeatureClassToNumPyArray("fc", ["SHAPE@XY"]) ## get feature class as structured numpy array
spatRef = arcpy.Describe("fc").spatialReference
arcpy.da.NumPyArrayToFeatureClass(a,'b',['SHAPE@XY'],spatRef)

generates the same error message. Any hints on why this doesn’t work?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP