4

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.

whuber
70.4k16 gold badges189 silver badges285 bronze badges
asked Sep 9, 2011 at 17:16

1 Answer 1

6

You might try using a scratch workspace or an inmemoryworkspace.

answered Sep 9, 2011 at 17:44
11
  • 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.) Commented Sep 9, 2011 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. Commented Sep 9, 2011 at 19:25
  • Both of these are actually very useful for me (inmemory and GDBscratch). Thanks for the insight @Craig. Commented Sep 9, 2011 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. Commented Sep 9, 2011 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. Commented Sep 9, 2011 at 21:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.