I have two rasters (an ESRI grid and an IMAGINE image) that differ in projection, extent and cell size. I want to convert the IMAGINE to an ASCII, and want it to have the extent, cell size and projection of the ESRI grid. I've set global environment variables (extent, output CRS, cell size, snap raster) to match the values in the ESRI grid, and the ASCII that results from RasterToASCII_conversion has the correct projection and extent, but ignores the cell size setting.
However, if I use the Raster and ApplyEnvironment tools (see code below) from the Python console, the output is as expected (correct cell size, extent, etc).
import arcpy
arcpy.env.extent = 'c:/path/to/grid'
arcpy.env.cellSize = 'c:/path/to/grid'
arcpy.env.outputCoordinateSystem = 'c:/path/to/grid'
arcpy.env.snapRaster = 'c:/path/to/grid'
r = arcpy.Raster('c:/path/to/imagine')
arcpy.CheckoutExtension('Spatial')
rclip = arcpy.sa.ApplyEnvironment(r)
rclip.save('c:/path/to/outfile')
While I could do the above and then convert the resulting grid to ASCII, I'd prefer to do the whole procedure without using Spatial Analyst. Is this possible?
I'm using ArcGIS 10.