[Beginner question] Raster to ASCII

Tim Chase python.list at tim.thechases.com
Sun Nov 14 20:45:20 CET 2010

On 11/14/2010 01:07 PM, Becky Kern wrote:
> import arcgisscripting
> gp = arcgisscripting.create(9.3)
> InRaster = "C:/data/raster1"
> OutAsciiFile = "C:/data/raster2ascii.asc"
> gp.RasterToASCII_conversion(InRaster, OutAsciiFile)
> The error message:
> arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
> raster1 does not exist.

While I can't speak specifically to arcgisscripting, having no 
experience with it, the error _sounds_ like the InRaster file 
isn't found.  It's the only reference to "raster1" in your code 
and the error points directly at "raster1".  My suspicion is that 
you're missing an extension...something like

   InRaster = "C:/data/raster1.rst"

with whatever the corresponding extension is.  Alternatively, 
it's pointing at directory named "raster1" instead of a file.


More information about the Python-list mailing list