Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i.modis.import: change cwd to input data dir #199

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

landam
Copy link
Member

@landam landam commented Jun 6, 2020

To reproduce

i.modis.import input=~/geodata/modis/MCD19A2.A2019031.h18v03.006.2019036210121.hdf -t --o
ls *.tif -w1
MCD19A2.A2019031.h18v03.single_AOD_QA.tif
MCD19A2.A2019031.h18v03.single_Optical_Depth_055.tif

Important on Windows

This is causing serious problem on Windows (here current working directory is set to C:\ by default).

i-modis-win-bug

@landam landam requested a review from lucadelu June 6, 2020 22:15
@landam landam added the bug Something isn't working label Jun 6, 2020
@neteler
Copy link
Member

neteler commented Jun 7, 2020

Wouldn't it be better to use the standard .tmp directory of GRASS here, in the mapset?
We sometimes have the input directory as read only network directory, would that still work with this PR?

@landam landam changed the title change cwd to input data dir i.modis.import: change cwd to input data dir Jun 7, 2020
@landam
Copy link
Member Author

landam commented Jun 7, 2020

Wouldn't it be better to use the standard .tmp directory of GRASS here, in the mapset?
We sometimes have the input directory as read only network directory, would that still work with this PR?

No, there must be write permission on the directory where temporary data is stored (see original problem on Windows).

Yes, I was thinking about .tmp, but there is -t flag.

  -t   Preserve temporary files (TIF and HDF mosaic)

In the case of -t flag it doesn't make sense to store temporary data in .tmp directory.

Option 1: store temporary data in input data dir (this PR)

Option 2: store temporary data in .tmp when -t is not given otherwise in input data dir

@neteler @lucadelu What do you think?

@landam landam requested a review from neteler June 7, 2020 13:26
@neteler
Copy link
Member

neteler commented Jun 7, 2020

Will there be a fallback in case the input data directory is read only as it sometimes occurs?

@landam
Copy link
Member Author

landam commented Jun 7, 2020

Will there be a fallback in case the input data directory is read only as it sometimes occurs?

Do you mean when -t flag given? @neteler What about this?

  1. no -t flag -> use .tmp
  2. -t flag -> use input data dir (if not writable fails with error)

OR

  1. no -t flag -> use .tmp
  2. use .tmp, after import copy temporary data to input data dir (if not writable fails with error, but data will imported anyway)

@lucadelu
Copy link
Contributor

lucadelu commented Jun 7, 2020

Will there be a fallback in case the input data directory is read only as it sometimes occurs?

Do you mean when -t flag given? @neteler What about this?

1. no -t flag -> use `.tmp`

2. -t flag -> use input data dir (if not writable fails with error)

I like more this option

@landam
Copy link
Member Author

landam commented Jun 9, 2020

Wouldn't it be better to use the standard .tmp directory of GRASS here, in the mapset?
We sometimes have the input directory as read only network directory, would that still work with this PR?

It needs more effort especially for mosaics (create VRT file in different directory where HDF files are located).

@landam landam merged commit 6fb4fd0 into OSGeo:master Jun 9, 2020
@landam landam deleted the i-modis-cwd1 branch June 9, 2020 06:42
@landam
Copy link
Member Author

landam commented Jun 9, 2020

I took liberty to merge this PR in order to make this addon functional on Windows. @neteler Also related issues #203 open.

landam added a commit to landam/grass-addons that referenced this pull request Nov 19, 2020
landam added a commit to landam/grass-addons that referenced this pull request Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants