Manually, one can export an XY Event Source to a shapefile by right-clicking on it, then selecting Data>Export Data. How would I automate this using Python? There doesn't seem to be a tool for this.
You can just convert the table source to a Feature Class with da.NumpyArrayToFeatureClass
http://resources.arcgis.com/en/help/main/10.1/index.html#//018w0000001n000000
import arcpy import numpy from numpy import genfromtxt csvFile = r'myfile.csv' dfarr = genfromtxt(csvFile,delimiter=',') arrayToConvert = numpy.array(dfarr, numpy.dtype([('X', '<f8'),('Y', '<f8')])) output = 'H:\Documents\Default.gdb\NumpyToFC' if arcpy.Exists(output): arcpy.Delete_management(output) arcpy.da.NumPyArrayToFeatureClass(arrayToConvert, output, ("X", "Y"))
Have you tried Copy Features?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.