grass-addons icon indicating copy to clipboard operation
grass-addons copied to clipboard

[Bug] i.modis.import fails when input data dir is read-only

Open landam opened this issue 5 years ago • 0 comments

Name of the addon i.modis

Describe the bug i.modis.import is currently creating temporary data in input data dir (see #199). It fails when this directory is read-only.

To Reproduce Steps to reproduce the behavior:

Run

i.modis.import.py input=~/geodata/modis/MCD19A2.A2019031.h18v03.006.2019036210121.hdf --o

see error

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pymodis/convertmodis_gdal.py", line 246, in _reprojectOne
    dst_ds = self.driver.Create(out_name, self.dst_xsize,
  File "/usr/lib/python3/dist-packages/osgeo/gdal.py", line 1676, in Create
    return _gdal.Driver_Create(self, *args, **kwargs)
RuntimeError: Attempt to create new tiff file `MCD19A2.A2019031.h18v03.single_Optical_Depth_055.tif' failed: Permission denied

Expected behavior

Temporary data should be produced in .tmp directory. It's not clear how to behave if -t is given, see https://github.com/OSGeo/grass-addons/pull/199#issuecomment-640231406

System description (please complete the following information):

  • Operating System: Windows, Linux
  • GRASS GIS version 7.8.3

landam avatar Jun 09 '20 06:06 landam