code like this:
calculate_boundary_weights(polys_in_area, scale=config.boundary_scale).to_file("/vsimem/weights.vrt")
gdal.Rasterize(mem_ds, "/vsimem/weights.vrt", bands=[n_bands+2], burnValues=[1], allTouched=True)
here is the problem:
Traceback (most recent call last):
File “/home/songzirui/桌面/planetunet-nonorm/main.py”, line 17, in
preprocessing.preprocess_all(config)
File “/home/songzirui/桌面/planetunet-nonorm/preprocessing.py”, line 233, in preprocess_all
gdal.Rasterize(mem_ds, “/vsimem/weights.vrt”, bands=[n_bands+2], burnValues=[1], allTouched=True)
File “/home/songzirui/anaconda3/envs/tfgdal/lib/python3.8/site-packages/osgeo/gdal.py”, line 1526, in Rasterize
srcDS = OpenEx(srcDS, gdalconst.OF_VECTOR)
File “/home/songzirui/anaconda3/envs/tfgdal/lib/python3.8/site-packages/osgeo/gdal.py”, line 4720, in OpenEx
return _gdal.OpenEx(*args, **kwargs)
RuntimeError: No such file or directory
I can’t figure out the exact usage of gdal’s vsimem, but i can print the content of “calculate_boundary_weights(polys_in_area, scale=config.boundary_scale)”, i wonder why i can’t write the content in /vsimem/weights.
HEXtoBIN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.