I'm trying to write an IN-Memory Dataset to a GeoTiff in Disk with gdal for python
gd_driver = gdal.GetDriverByName("MEM")
gd_raster = gd_driver.Create('pippo', src_height, src_width, src_NBands, gdal.GDT_Int16)
gd_raster.SetGeoTransform(gd_transform)
gd_raster.SetProjection(src_crs.wkt)
for i in range (0, src_NBands):
gd_raster.GetRasterBand(i+1).WriteArray(src_data[i])
# TO tiff
drv_out = gdal.GetDriverByName('GTiff')
dset_in = gdal.Open('/vsimem/pippo', gdal.GA_ReadOnly)
drv_out.CreateCopy(file_name_out, dset_in)
but i can not open and read source dataset
I found the error.
I have to put the source dataset (In Memoery dataset) in the second argument of createcopy without open it before
many thanks