Skip to content

Commit

Permalink
Merge pull request #51 from giswqs/develop
Browse files Browse the repository at this point in the history
Updated to WBT v2.2.0
  • Loading branch information
giswqs authored Oct 26, 2022
2 parents c114548 + 3edd96e commit 6e87531
Show file tree
Hide file tree
Showing 11 changed files with 708 additions and 163 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dev/
.vscode/
_build/
temp/
whitebox/__MACOSX/

# C extensions
*.so
Expand Down
13 changes: 10 additions & 3 deletions whitebox/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,25 @@
with open(os.path.join(WBT_dir, "whitebox_tools.py")) as f_wbt:
lines = f_wbt.readlines()
for index, line in enumerate(lines):
if line.strip() == "os.chdir(self.exe_path)":
f.write(" work_dir = os.getcwd()\n")
f.write(line)

if line.strip() == "from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW":
with open(os.path.join(work_dir, "download_wbt.py")) as f_dl:
dl_lines = f_dl.readlines()
f.write("\n")
f.writelines(dl_lines)
elif line.strip() == "self.__compress_rasters = False":
elif line.strip() == "self.__max_procs = -1":
f.write(" download_wbt()\n")

if line.strip() in ["return 1", "return err"]:
f.write(" finally:\n")
f.write(" os.chdir(work_dir)\n")


shutil.move(
os.path.join(WBT_dir, "whitebox_tools"), os.path.join(
work_dir, "whitebox_tools")
os.path.join(WBT_dir, "whitebox_tools"), os.path.join(work_dir, "whitebox_tools")
)


Expand Down
8 changes: 4 additions & 4 deletions whitebox/download_wbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ def download_wbt(verbose=True):
except:
pass

# The official WhiteboxTools Linux binary from whiteboxgeo.com requires GLIBC 2.29,
# which is incompatible with Google Colab that uses GLIBC 2.27. The following code
# downloads the binary that is compatible with Google Colab.
# # The official WhiteboxTools Linux binary from whiteboxgeo.com requires GLIBC 2.29,
# # which is incompatible with Google Colab that uses GLIBC 2.27. The following code
# # downloads the binary that is compatible with Google Colab.
if "google.colab" in sys.modules:
url = "https://github.com/giswqs/whitebox-bin/raw/master/WhiteboxTools_ubuntu_18.04.zip"
zip_name = os.path.join(pkg_dir, os.path.basename(url))
Expand All @@ -143,7 +143,7 @@ def download_wbt(verbose=True):
except Exception as e:
print(e)

webbrowser.open('https://www.whiteboxgeo.com/', new=2)
webbrowser.open("https://www.whiteboxgeo.com/", new=2)

if not os.path.exists(work_dir):
if verbose:
Expand Down
Binary file removed whitebox/img/WhiteboxToolsLogo_box_only.png
Binary file not shown.
210 changes: 99 additions & 111 deletions whitebox/img/WhiteboxToolsLogo_box_only.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added whitebox/img/WhiteboxToolsLogo_vert1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added whitebox/img/WhiteboxToolsLogo_vert2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added whitebox/img/WhiteboxToolsLogo_vert3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added whitebox/img/WhiteboxToolsLogo_vert4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6e87531

Please sign in to comment.