whitebox-tools
whitebox-tools copied to clipboard
thread 'main' panicked at 'The TIFF file does not contain geokeys'
I am trying to incorporate several whitebox tools into a geoprocessing workflow. Right now, I am just trying to test a few tools. I keep getting the same error:
thread 'main' panicked at 'The TIFF file does not contain geokeys', whitebox-tools-app\src\main.rs:72:21
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
I was able to import whitebox tools and set the working directory using wbt.set_working_dir
Here is an example of the code that results in the above error: wbt.fill_missing_data("SampleTiles_DEM.tif", "wbt_test_filled_DEM.tif", filter=15, weight=2.0)
Any tips would be appreciated! Thank you!
Can I ask how you created the GeoTiff file? It seems that there is an issue with reading the file.
A group of individual raster files were created with blast2dem from las tools. Then using gdal, a .vrt file was created to mosaic them together. Then gdal warp was used to create the actual GeoTiff. Thank you!
Are you able to share a sample of the DEM so that I can examine the file? It is clear from the error that the WBT reader is not recognizing this file as a properly formatted GeoTIFF. That isn't necessarily indicating that that is the case--WBT does not use GDAL but rather uses my own implementation of a GeoTIFF reader/writer and it is obviously more limited in the variations of GeoTIFF that it is able to process (I'm only one guy and GeoTIFF is a massive spec). Examining the problematic data can help me diagnose the problem and hopefully lead to improvements in the flavours of GeoTIFF WBT can work with.
Can you access the data here: (https://gmuedu-my.sharepoint.com/:i:/g/personal/cflynn8_gmu_edu/EfFcFjLFpn5Co3OcChIHeNIBKQ2nj5m4dn3tCNakixFdaw?e=M9anHg)
Thank you for being that "one guy"!
I'm downloading it now, thank you.
Everything works well if I create the raster using the whitebox tools lidar tin gridding and mosaic
The Geotiff I just loaded into a new thread might be another chance for you to track down the source of the error in parsing the GeoKeys. I know exactly how hard the Geotiff spec is.
I had this happen when I was working in a custom coordinate system. As soon as I reprojected to UTM it worked fine.
Hello. It is happening also to me.
I edited a tiff in photoshop and restored the coordinates using this tool
https://freegeographytools.com/2007/a-new-gui-for-the-libgeotiff-worldfile-utilities
I've uploaded the conflicting image and the cloud I whant to project into. https://mega.nz/folder/JsUAVZTS#EfZM44xBOx099ie3ECnQjQ
Hopefully it helps- I will try to do the reprojection tip suggest. I'm new to Qgis so hopefully I can handle that easily.
I confirm solution by @mbodnar-GS works! Raster-->Projection-->AsignProjections-->WGS84 (the only one in my dropwodown in my cas) PRojects flawlessly. Thank you so much!!
I tried to run the sink tool in ArcGISPro 3.2.1 on a .tif from the 3DEP national elevation dataset: USGS_1M_12_x51y380_AZ_USFS_3DEP_Processing_2019_D20.tif, and nothing happens. Then I used the DEM in the test data and it created output but there was no data (perhaps the test DEM doesnt have sinks?). Then I tried to run it on google colab and got this same error:
./whitebox_tools --run="Sink" --input='/content/drive/MyDrive/GIS/Test_data/USGS_1M_12_x51y380_AZ_USFS_3DEP_Processing_2019_D20.tif' --output='/content/drive/MyDrive/GIS/Test_data/sink_fil.tif' -v --compress_rasters=False
- Welcome to Sink *
- Powered by WhiteboxTools *
- www.whiteboxgeo.com *
Reading data...
thread 'main' panicked at 'The GeoTIFF reader does not currently support floating-point predictors (PREDICTOR=3).', whitebox-tools-app/src/main.rs:72:21
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace.
I tried reprojecting the raster into UTM zone 12, and WGS84 and still no output..... I also tried with and without a datum specified. Nothing seemed to work. Any other ideas?
Hi @Ryan3Lima, The error "The GeoTIFF reader does not currently support floating-point predictors (PREDICTOR=3)." is telling you that the compression method used in your raster is not supported by Whitebox. You just need to alter the raster so that it uses a different compression method or no compression.
Thanks! that worked