I want to import a tif file with Popen and then open it with gdal.open because I want to use other gdal utilities afterwards. The import with Popen seems to work. But for the line 'src_ds=gdal.Open(src_filename)' I get the following error:
return _gdal.Open(*args)
RuntimeError: not a string
Code
from osgeo import gdal,ogr
import struct
from subprocess import Popen, PIPE, STDOUT
user = "user"
host = "host"
dem = Popen(
["ssh", "{}@{}".format(user, host), "tif.tiff"], shell= True
)
dem.wait()
src_filename = dem
shp_filename = out_file1
src_ds=gdal.Open(src_filename)
gt=src_ds.GetGeoTransform()
rb=src_ds.GetRasterBand(1)
Thanks