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.

My current add-ons rely on shapefiles for working with temporary files. For example, if I run a spatial analyst tool, I create a new shapefile to store the output geometry. ArcGIS stores all temporary files in a default GDB. Can someone point me in the direction of some .NET code or resources that would help me to structure my temporary file handling in the same way? It would be nice to have everything in one GDB that could be cleared, rather than in a folder containing many shapefiles and rasters.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You might try using a scratch workspace or an inmemoryworkspace.

share|improve this answer
1  
Follow-up on this. I'd recommend trying InMemoryWorkspace first so you can avoid writing to disk. If that doesn't meet your needs (it doesn't support everything) then use FileGDBScratchWorkspaceFactory. There is really no need to use ScratchWorkspaceFactory anymore (it is based on a personal GDB and has all the limitations of personal GDBs with file size etc.) –  Craig Williams Sep 9 '11 at 17:51
1  
@Craig Williams; actually its based on the fGDB not Personal or MDB file; and it is set to the default 4GB max-size. I found this to be problematic with large jobs where I needed to write out more than that; instead of the default of no-size-limit to keep expanding it would crash my process. This is by design of ESRI to keep a run-a-way process from eating all your disk and then crashing your machine. It really should be optional. –  D.E.Wright Sep 9 '11 at 19:25
    
Both of these are actually very useful for me (inmemory and GDBscratch). Thanks for the insight @Craig. –  Nick Ochoski Sep 9 '11 at 20:10
    
@Craig I think inmemoryworkspaces will become even more useful when arcgis server is available for 64 bit. However, to truly leverage that, a new option is needed when creating an msd file: an option that lets you specify that a layer's featureclass should be cached into memory when the map service starts up. This should improve performance. –  Kirk Kuykendall Sep 9 '11 at 20:59
    
@D.E.Wright ScratchWorkspaceFactory is based on Access. FileGDBScratchWorkspaceFactory is based on FileGDB. This is a very important distinction. InMemoryWorkspace is different from personal or FileGDB. –  Craig Williams Sep 9 '11 at 21:52

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.