TopoToolbox / topotoolboxr

R interface to TopoToolbox
GNU General Public License v3.0
0 stars 2 forks source link

added a gradient wrapper functions #12

Open FancyBirb opened 4 days ago

FancyBirb commented 4 days ago

This will bring everything from the last pull request "add terra" and also a few files to make gradient8 from libtotopotoolboxr accessible in R.

I tried wrap_gradient8 on a real tiff and it seems to output wrong values, but at least it doesn' crash for now. We ight have to change the input of the function to just be a Spatrast, but first i would like to know your opinion/expertise on the overall way this is implemented.

To use this, i did:

tiff<-rast("../srtm_bigtujunga30m_utm11.tif") gradientTiff<-rast("../srtm_bigtujunga30m_utm11.tif") values(gradientTiff)<-wrap_gradient8(matrix(0,643,1197),values(tiff),30,0,c(643,1197)) plot(gradientTiff)

The plot just seems to be shifted.