6

I created a number of feature datasets to temporarily store the output of some ModelBuilder models. Each dataset contains several thousand feature classes, and the idea was that I could just delete the feature dataset when I was finished with the ModelBuilder output, instead of deleting each feature class individually (which would take forever!).

However, I've been using the Delete (Data Management) tool to delete the feature datasets, and have found that all the feature classes within the dataset, rather than being deleted, are just turning up in the folder the feature dataset was stored in. I assumed that deleting the dataset would remove all that dataset's content also, but this doesn't appear to be the case. I Have tried to delete the feature classes using Windows Explorer (where I could highlight them all simultaneously and then press delete) but they don't show up.

So, could someone please tell me if there is a way to delete multiple feature classes (or all content within a feature dataset) in one go? Either in ArcGIS (using v10) or through Windows Explorer?

3 Answers 3

4

Perhaps you can save your temporary featureclasses into the "in_memory" workspace.

ArcGIS & Modelbuilder will automatically clean up your temporary datasets once the process is complete. Also, you will likely see a dramatic improvement in processing speed with your models. Working with data in memory is tremendously faster than writing to disk.

More specifically from help: "When using the in-memory workspace, any intermediate data should be deleted as soon as possible to free up those system memory resources. The Delete tool can be used to delete data in the in-memory workspace. Individual tables or feature classes can be deleted, or the entire workspace can be deleted to clear all the workspace contents."

0
4

I think you will need to use ArcPy for this and the code needed can be found at http://forums.arcgis.com/threads/23078-how-to-delete-all-featuresclasses-in-a-featuredataset-using-arcpy

import arcpy  
arcpy.env.workspace = r"C:\Temp\fileGeodatabase.gdb\featureDataset"  
for objFeatureClass in arcpy.ListFeatureClasses():  
    arcpy.Delete_management(objFeatureClass) 
0
2

I'm not sure what you mean by:

...rather than being deleted, are just turning up in the folder the feature dataset was stored in.

The featuredataset is stored within the root of the file geodatabase. You can indeed use the Delete (Data Management) tool on a featuredataset and it will delete the featuredataset and all featureclasses within - I just tried to be sure and it worked.

You definitely do not want to mess with your file geodatabase in Windows Explorer, you run a high risk of messing it up beyond use.

Is the geodatabase still functioning properly? I'm wondering if something went wrong during your Delete process and now you have remnants of your featureclasses lingering around in the geodatabase somehow.

Also bear in mind that it could take a while to delete thousands of featureclasses.

5
  • yes, I was meaning that the feature classes ended up Getting transferred to the root of the file geodatabase rather than being deleted. also I've just noticed that they are listed as tables rather than spatial data for some reason. Seems pretty weird. The geodatabase seems to be working apart from this though. Cheers
    – jay
    Jan 19, 2012 at 3:22
  • @jay - I've seen that happen (FCs ends up as tables in the root) before when during processing, your process cannot acquire a unique schemalock on the file geodatabase, or the file geodatabase is accessed (or someone tries to access it) during processing. Did everything complete without error? Jan 19, 2012 at 11:43
  • hi Chad, As far as I'm aware the processing completed without error (except for not deleting the entire feature database!). Cheers
    – jay
    Jan 22, 2012 at 19:59
  • just tried deleting another feature dataset and got an error message about acquiring a unique schemalock - so looks like that may have been the problem.
    – jay
    Jan 24, 2012 at 19:20
  • ...and after reading up on this error, found a workaround is to uncheck open the properties of the file gdb folder in windows explorer and uncheck 'read only'. Did this and now it deletes fine... no pesky tables left over.
    – jay
    Jan 24, 2012 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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