Tabulate Area temp files lingering in 10.1 sp1

3025
2
12-06-2012 06:24 AM
PhilMorefield
Occasional Contributor III
I'm running a Python script that calls Tabulate Area a few thousand times. After receiving the "Fatal ERROR (INFDEF)" error a few times, I poked around and found that all of the temporary raster (e.g., 't_t908', 't_t_909', etc.) are sitting in the scratch working directory, still with ArcGIS locks and this is causing my problem. Some other important bits of information:

  1. This script ran fine with 10.1. The only change (that I know of) was the installation of sp1.

  2. I've tried many different scratch workspaces. Even if the temp files are in a FGDB, the script eventually bombs out.


I'd love to hear some ideas. Any fixes besides going away from GRID format for good?
0 Kudos
2 Replies
FilipKrál
Occasional Contributor III

Hello,

I ran into the exact same problem. My Python script fails with "Fatal ERROR (INFDEF)" because the number of temporary files is apparently too high for the info grid format.

Is there any workaround? Can I control the format of these temporary files so they can be stored as IMG instead? Is there a way to cleanup the temporary files during the script run? These are not "intermediate" files, ArcGIS seems to create them behind the scenes. My workspace and scratch workspace are set to two different file geodatabases but these temporary files seems to be created in C:\Users\<username>\AppData\Local\Temp regardless. Can I control where these files get created?

Regards,

Filip.

0 Kudos
FilipKrál
Occasional Contributor III

Hi,

In case of the TabulateArea tool, the temporary rasters get created when input zones are features and not a raster. The only way I found around this issue was to convert my zones from polygons to raster before the tabulate area is called. That way, it is possible to control where the raster is created and so it can be deleted afterwards.

Other tools in the Zonal Statistics toolset may require similar approach to avoid the Fatal ERROR (INFDEF).

I also found that this error may occur with other SpatialAnalyst tools in Python when you do not explicitly save them to hard drive - ArcGIS saves temporary rasters to temporary directory and doesn't clean up. Here is how to avoid it:

# when a and b are rasters:
c = arcpy.sa.Add(a, b) # c is is "temporary" and resides in temporary folder
c.save("c:\sws.gdb\temp") # c is "permanently" saved in specified path and removed from the temporary folder
arcpy.management.Delete(c) # c is removed from where it was "permanently" stored

There are rules about how ArcGIS determines the scratch folder​ but unless you can direct the temporary rasters to a geodatabase or save them as something else than ArcINFO Grids, you are going to run into the same issue.

If you know a more elegant solution, I am eager to hear about it.

Filip.

0 Kudos