5

I have been using in-memory workspace for creating temporary features, but I was wondering if we could create a temporary in-memory geodatabase (using ArcPy) and then use it for importing other in-memory features?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Oct 2, 2013 at 1:00
0

2 Answers 2

10

As @PolyGeo said, you won't be able to use the in_memory workspace for Geodatabases.

If you want a "temporary" geodatabase that is saved on disk, you can use the Scratch GDB.

#Set the path to GDB, if desired. 
#Consult help if you don't want to set this and want to know its location.
arcpy.env.scratchWorkspace = r"D:\GIS\data"
#Path to newly created gdb.
gdb = arcpy.env.scratchGDB
print gdb
>>> "D:\GIS\data\scratch.gdb"
answered Oct 2, 2013 at 1:36
0
8

An in_memory workspace is one of the three broad categories of workspace available to you - the others are folder and geodatabase.

However, you can think of the in_memory workspace being already analogous in structure to a file geodatabase held in memory, but there are limitations that are mostly documented.

What you are describing sounds like it is outside the design of in_memory workspaces.

I frequently write/read/process feature classes to/from/in in_memory workspaces using ArcPy but when I want to make them available in a file (or any other type of) geodatabase I copy them to disk.

answered Oct 2, 2013 at 1:24

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.