NumPyArrayToRaster ignores the lower_left_corner if an extent ist set. The result is stupid.I did following to check the problem:New mxd.Create Random Raster with defaults.Python window:
>>> LL = arcpy.Raster('CreateRandom1').extent.lowerLeft
>>> LL.X += 100
>>> LL.Y += 100
>>> numras = arcpy.RasterToNumPyArray('CreateRandom1', LL, 100, 100, arcpy.Raster('CreateRandom1').noDataValue)
>>> numras.shape
(100, 100)
>>> LL
<Point (100.0, 100.0, #, #)>
>>> outras = arcpy.NumPyArrayToRaster(numras, LL, 1, 1, arcpy.Raster('CreateRandom1').noDataValue)
>>> arcpy.env.extent
>>> arcpy.env.extent = arcpy.Raster('CreateRandom1').extent
>>> outras1 = arcpy.NumPyArrayToRaster(numras, LL, 1, 1, arcpy.Raster('CreateRandom1').noDataValue)
Results:CreateRandom1 and outras (without extent):[ATTACH=CONFIG]13488[/ATTACH]CreateRandom1 and outras1 (with extent, yellow:NoData)[ATTACH=CONFIG]13489[/ATTACH]The LL-Parameter is unused in outras1. The extent is not the extent of the NumPyArray. outras2 is set to the upperleft-corner of the extent.In my opinion this is wrong.Solution: Setting the extent before calling NumPyArrayToRaster. Maybe it is necessary to buffer the extent for other reasons before changing it.