I have problems to close a file created in GDAL
I have the following code (it's a part of bigger piece of code):
driver = gdal.GetDriverByName("GTiff") SAL01=driver. Create(Fnout1,afile.shape,afile.shape,1,tipoarr) SAL01.SetProjection(proj) SAL01.SetGeoTransform(trans) SAL01.GetRasterBand(1).SetNoDataValue(10000) band = SAL01.GetRasterBand(1) band.WriteArray(afile) band.FlushCache() band.ComputeStatistics(False) Fnout.close()
The error when process Fnout.close() is 'str' object has no attribute 'close'
In fact, Fnout is a string (used to generate the file name) and not a 'file' object.
Any simple way to close the file using the string as reference?