Skip to content

Failed to use the mosaic function in whitebox (python script) #309

@lthough123

Description

@lthough123

Hello,

I find that there is a problem when I tried to use the mosaic function in the whitebox python package.
I used the following codes (according to the example in the tutorial):

import os,glob
import whitebox

wbt=whitebox.WhiteboxTools()

wbt.set_verbose_mode(True)
input_directory = r"M:\Clumpingindex\test"
output_directory = r"M:\Clumpingindex\output"

if os.path.isdir(output_directory) != True:
os.mkdir(output_directory)

wbt.set_working_dir(input_directory)
outfile = os.path.join(output_directory,"test.tif")
wbt.mosaic(
output=outfile,
method = "nn"
)

and here is the error report:
.\whitebox_tools.exe --run="Mosaic" --wd="M:\Clumpingindex\test" --output='M:\Clumpingindex\output\NAME_OF_FILE.tif' --method=nn -v --compress_rasters=True



Number of tiles: 2
Reading data...
thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', whitebox-raster\src\geotiff\mod.rs:797:44
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Can you help me fix this problem? Thanks a lot.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions