Select to view content in your preferred language

'memory' workspace not respected in WFStoFeatureClass GP tool

1076
4
09-03-2021 03:40 PM
alex_friant
Frequent Contributor

I'm trying to utilize the in memory workspace in Pro using the GP tool arcpy.conversion.WFSToFeatureClass but when I use r"memory" as the out_path, instead of placing the feature class into memory, it creates a file geodatabase on disk <Result C:\\data\memory.gdb>

A different tool, arcpy.conversion.FeatureClassToFeatureClass uses the same variable for the same purposes, out_path, respects it and places the result into <Result 'memory\myfcname'>

Clearly, the tools don't work the same way concerning outputting to memory, but the documentation provides no indication as such. Can anyone shed any light if there is a work around for this issue? I really want to use the in memory workspace for the WFS conversion to Feature Class. Thank you!

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

You could use your project Scratch gdb instead of "memory".  At least it won't clutter a critical or project gdb with throwaway calculations.

Not all things are "faster" using the memory workspace btw, if your intent is to speed processes up.


... sort of retired...
0 Kudos
alex_friant
Frequent Contributor

If you're not in Pro, but rather in a stand-alone jupyter notebook, can you still designate a "scratch" gdb?

0 Kudos
JoeBorgione
MVP Emeritus

I keep C:\temp\scratch.gdb for things like this and purge it every few months or when I remember to. You could always just creat a scratch gdb in your notebook and delete it when you are done  

Seems like the memory workspace has had problems. I used in_memory in python 2.x  but I’ve never used the newer memory workspace. 

That should just about do it....
0 Kudos
DanPatterson
MVP Esteemed Contributor

yes... it is just a workspace and it will work if you have Pro installed on the machine you are running the notebook from. (you can import arcpy right?)


... sort of retired...
0 Kudos