I'm trying to figure out why I can't copy a featureclass from one file GDB to another. I can copy the featureclass to within the source GDB. There's no name conflict in the target GDB. I don't think I've set any GDB constraints that would stop me. I'm running 10.0 ArcGIS. Any thoughts?

Here's what I've done to explore a bit and the error that I get.

[Dbg]>>> arcpy.env.workspace
[Dbg]>>> arcpy.env.overwriteOutput
[Dbg]>>> arcpy.Exists('nsegment_flowlinesFL')
[Dbg]>>> arcpy.GetCount_management('nsegment_flowlinesFL')
<Result '5530'>
[Dbg]>>> desc = arcpy.Describe('nsegment_flowlinesFL')
[Dbg]>>> desc.dataElement.catalogPath
[Dbg]>>> arcpy.CopyFeatures_management('nsegment_flowlinesFL', 'C:\\Workspace\\wk_NHDPlus\\NHDPlus03_wk.gdb\\Output\\junk')
<Result 'C:\\Workspace\\wk_NHDPlus\\NHDPlus03_wk.gdb\\Output\\junk'>
[Dbg]>>> arcpy.CopyFeatures_management('nsegment_flowlinesFL', 'C:\\Workspace\\wk_NHDPlus\\NHDPlus03_Final.gdb\\PRMS\\junk')
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 1943, in CopyFeatures
    raise e
ExecuteError: ERROR 000210: Cannot create output C:\Workspace\wk_NHDPlus\NHDPlus03_Final.gdb\PRMS\junk
Failed to execute (CopyFeatures).
  • Does the feature rely on any coded values or have any topology dependencies? – nagytech Jun 21 '13 at 1:45
  • 1
    Does the PRMS FeatureDataset already exist? Are there any locks on the Final.gdb? – RyanKDalton Jun 21 '13 at 3:00
  • If the source or target is in a feature dataset with a topology that can create problems copying. – johns Jun 21 '13 at 17:00
  • @RyanDalton: yes the PRMS FeatureDataset does already exist. – Roland Jun 21 '13 at 17:31
  • @Geoist and johns (sorry can only reference one person in a comment apparently): There is topology in the class, but none of the rules pertain to the featureclass in particular. I could definitely be overlooking something. I'm a bit of superficial topology user. – Roland Jun 21 '13 at 17:32

You should test for "junk" in NHDPlus03_Final.gdb.

print arcpy.Exists(C:\\\Workspace\\\wk_NHDPlus\\\NHDPlus03_Final.gdb\\\junk)

This will return True if "junk" exists anywhere in the geodatabase, including in a FeatureDataSet.
You cannot duplicate a FeatureClass name in a geodatabase, even if you have FeatureDataSets to help organize your data.

| improve this answer | |
  • I'll check that. I do have most of my content nested under a FeatureDataset. I could be missing the presence of "junk" elsewhere. I didn't do this originally because arcpy.env.overwriteOutput=True and figured whatever there would get clobbered--but this won't work if it's outside of the FeatureDataset I'm trying to use. – Roland Jun 21 '13 at 17:29

I would like to give this point to @RyanDalton for his comment about checking for file locks, which turned out to be my issues. I'll select this answer as correct to make it easier for subsequent readers. Thanks to all!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.