Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

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

share|improve this answer
    
Great will try this thanks –  jay Jan 19 '12 at 3:20
add comment

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.

share|improve this answer
    
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 '12 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? –  Chad Cooper Jan 19 '12 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 '12 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 '12 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 '12 at 19:22
add comment

Have you considered, or is it possible, to 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."

share|improve this answer
    
Thanks, will definitely look into this for future runs (especially since my model took a looong time to run!). This time it's too late though as I've already run the models. Thanks for the advice. –  jay Jan 19 '12 at 3:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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