twadd

Ascii to Raster Parameters are not valid

Discussion created by twadd on Nov 6, 2011
Latest reply on Nov 7, 2011 by Dan_Patterson
This is a simple script that I have used many times before, the only difference this time is that I am not using the exact directory. But instead a workspace + "" method so that the final script and be used on any computer (the workspace is initially defined at the beginning of the script). Here I the script, I have looked it over several times and so have my colleges this is only one part of the main script but there are so many errors with it even though it has previously work so trying to debug them one at a time.

Can some one please explain why when I run the Ascii to raster conversion the 'Parameters are not valid'? (This happens on the first conversion attempt)

Here is the script that i have been using.

# Import system modules
import sys, string, os, arcgisscripting

#Create the Geoprocessor object
gp = arcgisscripting.create(9.2)

#Check out any necessary licenses
gp.CheckOutExtension("spatial")
# Check out ArcGIS 3D Analyst extension license
gp.CheckOutExtension("3d")
gp.CheckOutExtension("arc")

gp.overwriteoutput = 1

# Load required toolboxes...
gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Conversion Tools.tbx")
gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/3D Analyst Tools.tbx")
gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Spatial Analyst Tools.tbx")
gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Spatial Statistics Tools.tbx")

             
            

#ASCIIToRaster
workspace = "H:\tom\old_code\data/"
ASCII_file = "H:\tom\old_code\data/dhm25.asc" #sys.argv[1]
ASCIIFOR_file = "H:\tom\old_code\data/forest.asc" #sys.argv[2]
Output_DEM_raster = workspace + "dem"
Resample_raster = workspace + "dem_resample"
Resample_for = workspace + "for_resample"


# Process: ASCIIToRaster_conversion
print gp.GetMessages()
gp.ASCIIToRaster_conversion(ASCII_file, Output_DEM_raster, "FLOAT")
gp.ASCIIToRaster_conversion(ASCIIFOR_file, workspace + "forest", "FLOAT")

Outcomes