def create_geotiff(name, Array, driver, ndv, xsize, ysize, geot, projection, datatype, band=<NUM_LIT:1>):
if isinstance(datatype, np.int) == False:<EOL><INDENT>if datatype.startswith('<STR_LIT>') == False:<EOL><INDENT>datatype = eval('<STR_LIT>'+datatype)<EOL><DEDENT><DEDENT>newfilename = name+'<STR_LIT>'<EOL>Array[np.isnan(Array)] = ndv<EOL>DataSet = driver.Create(newfilename, xsize, ysize, <NUM_LIT:1>, datatype)<EOL>DataSet.SetGeoTransform(geot)<EOL>DataSet.SetProjection(projection.ExportToWkt())<EOL>DataSet.GetRasterBand(band).WriteArray(Array)<EOL>DataSet.GetRasterBand(band).SetNoDataValue(ndv)<EOL>return newfilename<EOL>
Creates new geotiff from array