opengeos / whiteboxR

WhiteboxTools R Frontend
https://whiteboxR.gishub.org
Other
168 stars 30 forks source link

wbt_viewshed not working on tif file outputted by Terra #90

Closed JacobusS closed 1 year ago

JacobusS commented 1 year ago

Hi,

The wbt_viewshed() function works fine on a clapped raster, done with QGIS from a very large DEM. However if I crop and/or mask the large raster using Terra package the wbt_viewshed function outputs a blank raster from the clip.

I tried to use writeRater() with ,gdal="COMPRESS=NONE", thinking that it might be the way terra compresses the raster. But had no luck with that.

I thought that I might clip the raster using whitebox. But I couldn't find a crop/clip function in whitebox, or am I missing something?

By the way this package is honestly just mind blowing, thanks to everyone working on this and Whitebox itself.

jblindsay commented 1 year ago

Sounds like this might be a back-end issue, not an R front-end issue. I'd ask that you open an issue an the whitebox-tools repository instead. It would be helpful if you could provide me with a data set to test the issue as well. Lastly, for cropping the DEM, you can use ClipRasterToPolygon tool:

Screenshot 2022-12-06 at 8 10 09 AM

Just be sure to uncheck the Maintain input raster dimensions option (I should really change that default value).

JacobusS commented 1 year ago

That is great, thank you. Apologies I missed the wbt_clip_raster_to_polygon function. Works 100%. Thanks for the help