J'essaie de copier des classes d'entités d'un dossier dans une nouvelle géodatabase, mais aucun des fichiers ne sera copié dans la nouvelle géodatabase. Pourquoi ne copient-ils pas?Comment copier des classes d'entités dans une nouvelle géodatabase dans ArcGIS/Python?
import arcpy
from arcpy import env
env.workspace="C:\\Users\\welchk\\Desktop\\HW6_data\\data\\"
env.overwriteOutput=True
#creating the gdb
arcpy.CreateFileGDB_management("C:\\Users\\welchk\\Desktop\\HW6_data\\data\\", "t_6.gdb")
#creates a list using ListFeatureClasses function
fclist=arcpy.ListFeatureClasses("*", "polygon")
#uses CopyFeatures_management function to copy feature classes in the list to the data folder.
for fc in fclist:
#Uses the describe function so below you can tell the basename
fcdesc=arcpy.Describe(fc)
#copies the features using a function that saves the new feature class with the basename.
arcpy.CopyFeatures_management(fc, "C:\\Users\\welchk\\Desktop\\HW6_data\\data\\t_6.gdb"+fcdesc.basename)