List data in "memory" workspace

826
3
Jump to solution
03-08-2022 02:38 PM
Labels (3)
AlexOestreicher
New Contributor

I have some sensitive data which I would prefer to only exist in memory and the remote database it is sourced from that I wish to use in ArcGIS Pro. Loading the data into the "memory" workspace is no problem, and so is deleting it, but managing large numbers of layers in memory is problematic. keeping track of which data exists in memory and which does not is difficult, as deleting the associated layers does not remove the data. In ArcGIS Pro, is there any way to list the data available in the "memory" workspace?

0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

Not all ArcPy functions that work with workspaces, e.g., ListFeatureClasses, work with the new "memory" workspace.  ArcPy DA Walk usually does if you know the underlying name of the workspace and not its "memory" alias.  Try:

next(arcpy.da.Walk("InMemoryDB\GPProMemoryWorkspace"))

View solution in original post

3 Replies
JoshuaBixby
MVP Esteemed Contributor

Not all ArcPy functions that work with workspaces, e.g., ListFeatureClasses, work with the new "memory" workspace.  ArcPy DA Walk usually does if you know the underlying name of the workspace and not its "memory" alias.  Try:

next(arcpy.da.Walk("InMemoryDB\GPProMemoryWorkspace"))
AlexOestreicher
New Contributor

thanks! this works great!

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

If someone's reply works for you, please accept it as a solution so others can tell there is a solution to the question when browsing questions.

0 Kudos