Open markjessell opened 8 months ago
I did use in memory files for netCDF based and http based heightmaps but for some reason I couldn't get WebCoverageService based heightmaps to load into memory. This is the only case it is necessary.
I'm reoppening this issue because if the user doesn't have permission to write to the m2l_data_tmp/StupidGDALLocalFile.tif file then it will crash map2loop.
For me I get an error if I run the plot_hamersley example from a root directory. E.g. from the map2loop repo run python docs/examples/plot_hamersley.py' will return
PermissionError: [Errno 13] Permission denied: 'm2l_data_tmp/StupidGDALLocalFile.tif'` but if I run from the docs/examples directory it will work.
Why not use the system tmp directory? https://docs.python.org/3/library/tempfile.html
Good idea, we're already using tempfile
in some of the tests, e.g., https://github.com/Loop3D/map2loop/blob/master/tests/thickness/StructurePoint/test_thickness_StructuralPoint_local_source.py, and seems to be working well.
Did you try https://gdal.org/user/virtual_file_systems.html#vsimem-in-memory-files
GDAL writing to and reading from virtual memory?