Error running Batch Watershed Delineation - trying to write to system folder

4342
1
01-21-2015 12:55 PM
Labels (1)
curtvprice
MVP Esteemed Contributor

I am getting an error running Batch Watershed Delineation (ArcMap 10.2.2, ArcHydro 10.2.0.85):

WshDelineationFromPointAndAdjointCatchment:System.Runtime.InteropServices.COMException (0x80041098): ERROR 010429: Error in GRID IO: CellLyrCreateInternal: Unable to create cell layer directory c:\windows\system32\ras0421  .

ERROR 010067: Error in executing grid expression.

   at ESRI.ArcGIS.SpatialAnalyst.RasterHydrologyOpClass.Watershed(IGeoDataset directionRaster, IGeoDataset sourceDataset)

Note the software is trying to write to C:\Windows\system32 (a system folder). Any ideas?

UPDATE:

Deleting the ArcHydro temp folder in TEMP:

C:\Users\user\AppData\Local\Temp\1\arc5694\

and restarting ArcMap solved the problem. I'm assuming the tool was having trouble writing there and then failing over to the system folder, although my C drive had plenty of space.

0 Kudos
1 Reply
nicogis
MVP Frequent Contributor

you can write similar code to randomize path for every task generate intermediate raster

static Random random = new Random();
internal static char GetLetter()
{
            // This method returns a random lowercase letter.
            // ... Between 'a' and 'z' inclusize.
            int num = random.Next(0, 26); // Zero to 25
            char let = (char)('a' + num);
            return let;
}


IHydrologyOp2 hydrologyOp = new RasterHydrologyOpClass();
IRasterAnalysisEnvironment rasterAnalysisEnvironment = hydrologyOp as IRasterAnalysisEnvironment;
rasterAnalysisEnvironment.DefaultOutputRasterPrefix = Helper.GetLetter() + (Guid.NewGuid().ToString("N")).Substring(0, 3);


 

so you have :

C:\Users\user\AppData\Local\Temp\1\XXXX5694\     (XXXX  string random)

0 Kudos