Select to view content in your preferred language

Script runs perfectly, but no output raster created

759
2
02-20-2011 10:04 AM
MatthewBrigham
Deactivated User
I have the following script that runs without errors, but fails to produce an output raster that is added to the display.  Any idea why this is happening?:

#Import arcpy module
import arcpy

# Script arguments
wksp = arcpy.GetParameterAsText(0)
DEM_Dataset = arcpy.GetParameterAsText(1)
Landuse_Data = arcpy.GetParameterAsText(2)
Output = arcpy.GetParameterAsText(3)
arcpy.env.workspace = wksp

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
arcpy.env.overwriteOutput=True

# Local variables:
Slope_Output = "DEM_Dataset"
Slope_Reclass_Output = "Slope_Output"
Aspect_Output = "DEM_Dataset2"
Aspect_Reclass_Output = "Aspect_Output"
Landuse_Reclass = "Landuse_Data"

# Process: Aspect
arcpy.gp.Aspect_sa(DEM_Dataset, Aspect_Output)

# Process: Aspect Reclass
arcpy.gp.Reclassify_sa(Aspect_Output, "Value", "-1 0 3;45 135 2;135 225 3;225 315 2;315 360 1", Aspect_Reclass_Output, "DATA")

# Process: Slope
arcpy.gp.Slope_sa(DEM_Dataset, Slope_Output, "DEGREE", "1")

# Process: Slope Reclass
arcpy.gp.Reclassify_sa(Slope_Output, "Value", "0 3 3;3 6 2;6 90 1", Slope_Reclass_Output, "DATA")

# Process: Reclassify Landuse
arcpy.gp.Reclassify_sa(Landuse_Data, "Value", "1 17 0;18 1;19 72 0;73 1;74 242 0", Landuse_Reclass, "NODATA")

# Process: Arcpy Math
PlusOutput = arcpy.gp.plus_sa(Aspect_Reclass_Output, Slope_Reclass_Output)
BestSite = arcpy.gp.times_sa(PlusOutput, Landuse_Reclass)
Tags (2)
0 Kudos
2 Replies
ChrisMathers
Deactivated User
What happens if you take the .gp out of the tools and just do arcpy.tool_toolbox?
0 Kudos
ChrisPedrezuela
Frequent Contributor
Hi guys, any solution to this problem? I tried this approach as well where each reclass row has 3 components. When I run my script, I get an erroneous raster data. when I check the xml file of the output raster, I saw that the remap string was changed from 3 component input to 2 components which would give that erroneous raster. Even if you export the tool within a model, the output exported script also will contain 3 component but when you run it, still same result.
0 Kudos