[gdal-dev] Problems using gdal python binding 'createcopy' function

William Hudspeth bhudspeth at edac.unm.edu
Thu Oct 7 10:50:05 EDT 2010


Hello,

I am trying to copy a GeoTiff to an AAIGrid file using the Python
osgeo-gdal CreateCopy() function. The metadata associated with the
function indicates that one can output a Float32-formatted file, but I
am having trouble figuring out exactly how the output format is
specified in a call to the function....

What I have is:

src_filename='input.tif'
src_ds=gdal.Open(src_filename)
dst_ds_format="AAIGrid"
dst_driver=gdal.GetDriverByName(dst_ds_format)
dst_filename='output.asc'
dst_ds_pm25=dst_driver.CreateCopy(dst_filename,src_ds,0,['Type=Float32'])
		    
The way I have written the output data type argument obviously doesn't
work... Can anyone help me with this?

Thanks much, 

Bill



More information about the gdal-dev mailing list