whitebox-tools icon indicating copy to clipboard operation
whitebox-tools copied to clipboard

thread 'main' panicked at 'The TIFF file does not contain geokeys'

Open cflynn8 opened this issue 3 years ago • 13 comments

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!

cflynn8 avatar Jan 18 '22 23:01 cflynn8

Can I ask how you created the GeoTiff file? It seems that there is an issue with reading the file.

jblindsay avatar Jan 19 '22 00:01 jblindsay

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!

cflynn8 avatar Jan 19 '22 16:01 cflynn8

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.

jblindsay avatar Jan 19 '22 16:01 jblindsay

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"!

cflynn8 avatar Jan 19 '22 17:01 cflynn8

I'm downloading it now, thank you.

jblindsay avatar Jan 19 '22 17:01 jblindsay

Everything works well if I create the raster using the whitebox tools lidar tin gridding and mosaic

cflynn8 avatar Jan 21 '22 20:01 cflynn8

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.

prof-pguth avatar Apr 03 '22 22:04 prof-pguth

I had this happen when I was working in a custom coordinate system. As soon as I reprojected to UTM it worked fine.

mbodnar-GS avatar May 26 '22 16:05 mbodnar-GS

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.

TokyoWarfare avatar May 31 '22 14:05 TokyoWarfare

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!!

TokyoWarfare avatar May 31 '22 14:05 TokyoWarfare

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



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?

Ryan3Lima avatar Feb 19 '24 23:02 Ryan3Lima

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.

jblindsay avatar Feb 20 '24 00:02 jblindsay

Thanks! that worked

Ryan3Lima avatar Feb 20 '24 00:02 Ryan3Lima