jblindsay / whitebox-tools

An advanced geospatial data analysis platform
https://www.whiteboxgeo.com/
MIT License
967 stars 161 forks source link

Inconsistencies in command parsing on Windows #20

Open AlisterH opened 6 years ago

AlisterH commented 6 years ago

Some issues I've noticed trying to run whitebox_tools on Windows and comparing with Linux:

In general it seems that either --wd needs to be used, or paths need to be provided for input and output files (i.e. whitebox_tools never just looks in the current working directory), but

jblindsay commented 6 years ago

Thanks for reporting these issues to me. I must admit that some of them (e.g. the order of the working directory) make me very curious because there is nothing in the code that should make it behave that way, especially the fact that it is different on Windows compared to linux/mac. I don't have ready access to a Windows machine for testing but as soon as I do, I'll dig into this to see if I can replicate. Thanks again for reporting the issue.

giswqs commented 6 years ago

@jblindsay Sometimes if you need access to a Windows machine to compile/test whitebox-tools, you can try VirtualBox and download a free Windows virtual mchine provided by Microsoft. I just tested one of the VM (IE11 on Win7), installed Build Tools for Visual Studio 2017 and Rust, and was able to compile whitebox-tools successfully.

AlisterH commented 5 years ago

On Windows NewRasterFromBase seems to require the use of --wd.

With 0.12.0 this seems to apply to other tools as well, e.g. AbsoluteValue and CreatePlane. Maybe it applies to everything?

jblindsay commented 5 years ago

@AlisterH I believe that this issue has now been resolved. If you can confirm this to be the case, I will close the issue.

AlisterH commented 5 years ago

fixed: testing NewRasterFromBase it seems that -wd can be omitted as long as you provide full paths for -i and -o fixed: the path no longer needs to include a trailing \ character not fixed: fails if -wd is not specified before -i and -o

jblindsay commented 5 years ago

@AlisterH I've had a chance to investigate this behaviour on a Windows machine and I can confirm the inconsistent behaviour with the placement of the --wd flag. NewRasterFromBase works with no issues if --wd is the first parameter or the last parameter. It does not work if it lies somewhere in the middle of the parameter list, UNLESS you use the '/' character as a path separator instead of the Windows default of '\'. I'll admit that I find this behaviour confounding. Looking at my code closely, I cannot figure out what might cause this. I'll keep on investigating it but thank you again for raising the problem.