Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 5 down vote accepted

You might try using a scratch workspace or an inmemoryworkspace.

share|improve this answer
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
@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. – Radar 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


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.