Solution to: [Beginner question] Raster to ASCII conversion

Becky Kern kern.ra at gmail.com
Mon Nov 15 15:14:56 EST 2010


Hi users,

Found a solution to my Raster to ASCII conversion problem, so I thought I'd
post.

My raster was created in ArcGIS 9.3 as an ESRI GRID (folder with associated
info folder). I needed to use the ListRasters method (see
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=958&pid=905&topicname=ListRasters_method)
to
get Python to recognize it as a raster. My functioning code is posted below.

>>import arcgisscripting
>>gp = arcgisscripting.create(9.3)
>>gp.workspace = "C:\Users\Lab User\Desktop\BKern\Blackwater\PVA\Scenario
1\Nov 15"
>>rasters = gp.ListRasters("","ALL")
>>for raster in rasters: print raster
...
scen1_11_15
>>InRaster = "scen1_11_15"
>>OutasciiFile = "C:\Users\Lab User\Desktop\BKern\Blackwater\PVA\Scenario
1\Nov 15\scen1.asc"
>>gp.RasterToASCII_conversion(InRaster, OutasciiFile)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101115/c4553654/attachment.html>


More information about the Python-list mailing list