Dear all,
I have to perform map algebra operations on rasters that have different extents, and I want to obtain an output on the union of the extents. I am doing this in a Python script; is there a way to configure Spatial Analyst output extent to "Union of Inputs" by calling a geoprocessor method from my script?
Thank you and best regards,
Cedric
ArcGIS Desktop 9.3.1, ArcInfo license.
You may need to review the environement settings for extent.
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=2237&pid=2229&topicname=Output_extent
also for Map Algebra in 9.3
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=6311&pid=6308&topicname=Single_Output_Map_Alg...
for example:
gp = arcgisscripting.create(9.3) gp.workspace = "C:/workspace" gp.Extent = "MAXOF" inExpresson = "C:\data\rasterA + C:\data\rasterB" gp.SingleOutPutMapalgebra_sa(inExpression,"outRaster")
Good luck
Ryan
Here's the 10.x flavor of this:
import arcpy
from arcpy.sa import *
arcpy.env.workspace = r"C:\Workspace"
arcpy.env.extent = "MAXOF"
outRaster = Raster(r"C:\data\rasterA") + Raster(r"C:\data\rasterB" )
outRaster.save("outRaster")
Output Extent (Environment setting)—Help | ArcGIS for Desktop