Unexpected issues while using in_memory Workspace

1093
6
Jump to solution
09-14-2021 02:40 AM
ROMANFILOZOF
New Contributor III

Hello colleagues,

I've created a model using ArcGIS Pro 2.5.1 that works fine when I write all outputs to the file geodatabase. So I want to improve performance and write intermediate outputs to in_memory Workspace. I was surprized to find that just changing the location of outputs that are not parameters can cause the issues.

For example Select by Attribute tool stops with a message "Invalid expression". After changing back to .gdb location it works fine. Here is the expression.

ROMANFILOZOF_0-1631611784922.png

Another model stopped on Erase tool with a message "Can't open a feature class" (or something like that) but after I've changed back to .gdb it works. Than I tried to repeat the error to make screenshot but the second time it worked with "in_memory" location.

Have any ideas what's wrong here? I'd like my models to work fast and predictable but now I'm confused.

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

@ROMANFILOZOF ,

You are getting the message "Invalid expression" because the Shape_Area field is most probably not available in your shapefiles' fields by default. But when you import your shapefiles into a gdb, some fields are automatically created/calculated by the gdb. These fields are Shape_Area, Shape_Length, ... and FID becomes OBJECTID.

I hope that helps.

Mehdi

View solution in original post

6 Replies
DanPatterson
MVP Esteemed Contributor

Do any of the issues discussed in

Considerations when using the in_memory workspace—ArcGIS Pro | Documentation

apply to your workflow in the model?  Anything being added to the display?


... sort of retired...
ROMANFILOZOF
New Contributor III

I studied that article before posting. Unfortunately nothing there explains my situation

0 Kudos
JohannesLindner
MVP Frequent Contributor

"in_memory" is the legacy workspace from ArcMap. ArcGIS Pro uses "memory", try using that.


Have a great day!
Johannes
ROMANFILOZOF
New Contributor III

The link in the previous post says that in_memory is used in Pro... So thanks for advise, I'll delete all "in_" from output locations and will be back with the results

0 Kudos
MehdiPira1
Esri Contributor

@ROMANFILOZOF ,

You are getting the message "Invalid expression" because the Shape_Area field is most probably not available in your shapefiles' fields by default. But when you import your shapefiles into a gdb, some fields are automatically created/calculated by the gdb. These fields are Shape_Area, Shape_Length, ... and FID becomes OBJECTID.

I hope that helps.

Mehdi

ROMANFILOZOF
New Contributor III

Thanks! That explains the expression error!

The other errors appear when I try to clear the memory Workspace using Delete tool.

Some features can't be read because they are already deleted and in other cases some features can't be deleted because are blocked by application.

Looks like there is some peculiarity of clearing the memory Workspace in a model with Iterator...

0 Kudos