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

Auto-expand home directory alias in file paths #31

Open
mwip opened this issue May 14, 2020 · 1 comment
Open

Auto-expand home directory alias in file paths #31

mwip opened this issue May 14, 2020 · 1 comment

Comments

@mwip
Copy link

mwip commented May 14, 2020

Using the alias '~/some/file.tif' for the paths relative to the home directory does not work. Using the full-path (i.e. '/home/user/some/file.tif') instead works just fine. I experienced that with gdal_translate on Ubuntu 18.04 LTS (R 3.6.3).

A solution would be to parse all parameters with file paths through path.expand() on Unix-like systems. To my knowledge, that would not interfere with Windows systems.

@mwip
Copy link
Author

mwip commented May 17, 2020

I tried to wrap my head around this. @jgrn307 what do you think would be the best place to implement this? I think it would be best to put some path.expand() in gdal_cmd_builder() but I am not quite sure if that is to your liking?

Another option would be to parse [src|dst]_[datasource|filepath|filename] through path.expand(). This could be favored, gdal has so many names for these files. Sometimes with flags, sometimes without... Gosh I love long grown software projects 🤣

If you let me know I will work on a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant