manuelgimond

Layer references a C:\Users\jdoe\AppData\Local\Temp\***.afr file

Discussion created by manuelgimond on Feb 11, 2011
Latest reply on Mar 3, 2011 by manuelgimond
This is a follow-up to my last post.

The following code does a proper job in creating both raster and layer files in a user defined directory (c:/tmp/ in this example), however, the layer file points to a temporary(?) .afr file under C:\Users\jdoe\AppData\Local\Temp\***.afr instead of pointing to the raster layer. ArcMap does not seem to have a problem displaying the layer when loaded in a layout, however, when trying to perform a map algebra operation on that layer, ArcMap returns an error stating that the raster cannot be found (i.e. it is looking for the .afr file).

Any idea what may be going on? I'm using version 10 SP1.

...
YMAP = arcpy.NumPyArrayToRaster(YmapArray,lowerLeft,pixSi ze,pixSize)
YMAP.save(YmapFile)
...
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
arcpy.MakeRasterLayer_management(YmapFile,"Y Map")
ymapLyr = arcpy.mapping.Layer(r"c:/tmp/YMAP.lyr")

Outcomes