opengeos/whitebox-python

WBT can't convert TAG to ASCII

Closed this issue · 0 comments

  • whitebox version: 2.3.4
  • Python version: 3.11.9
  • Operating System: ubuntu 20.04

Description

I have generated a tiff with wbt.fill_missing_data, however wbt itself can't parse result which it generated.

What I Did

dem='mosaic_hjlm_hgts.tif'
wbt = whitebox.WhiteboxTools()
work_dir = pathlib.Path(dem).parent.absolute()
wbt.set_working_dir(work_dir)
dem_fn = dem.split('.')[0]
wbt.fill_missing_data(i=dem, output=os.path.join(work_dir, f"{dem_fn}_fillmissingdata.tif"), filter=11, weight=2.0, no_edges=True)
wbt.fill_depressions_wang_and_liu(f"{dem_fn}_fillmissingdata.tif", f"{dem_fn}_filldepression.tif", fix_flats=True, flat_increment=None)

And this is log:

./whitebox_tools --run="FillMissingData" --wd="/home/username/interim/tests" --input='mosaic_hjlm_hgts.tif' --output='/home/username/interim/tests/mosaic_hjlm_hgts_fillmissingdata.tif' --filter=11 --weight=2.0 --no_edges -v --compress_rasters=False
******************************
* Welcome to FillMissingData *
* Powered by WhiteboxTools   *
* www.whiteboxgeo.com        *
******************************
Reading data...
Finding edge-connected NoData values...
Finding edge-connected NoData cells: 0%
Finding edge-connected NoData cells: 1%
……
Finding edge-connected NoData cells: 39%
Interpolating data holes...
Interpolating data holes: 0%
Interpolating data holes: 1%
……
Interpolating data holes: 99%
Interpolating data holes: 100%
Performing analysis: 0%
Performing analysis: 1%
……
Performing analysis: 99%
Performing analysis: 100%
Saving data...
Output file written
Elapsed Time (excluding I/O): 9min 44.703s

./whitebox_tools --run="FillDepressionsWangAndLiu" --wd="/home/username/interim/tests" --dem='mosaic_hjlm_hgts_fillmissingdata.tif' --output='mosaic_hjlm_hgts_filldepression.tif' --fix_flats -v --compress_rasters=False
****************************************
* Welcome to FillDepressionsWangAndLiu *
* Powered by WhiteboxTools             *
* www.whiteboxgeo.com                  *
****************************************
Reading data...
thread 'main' panicked at whitebox-raster/src/geotiff/ifd.rs:115:23:
**Error converting TAG(34737) to ASCII (value=[34, 195, 44, 7, 2, 0, 0, 0]) invalid utf-8 sequence of 1 bytes from index 1**
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

So how to solve this problem?