I had a look at sampleFromArea function within _plotgeodist.R but I didn't dare to modify the inner CRS transformations because I don't fully understand what is going on and I could somehow damage plot_geodist.
The way I solved it is:
NNDM (and subsequently kNNDM) now does not depend on sampleFromArea anymore, it now only accepts a polygon (same CRS as training points) as modeldomain (I think accepting a raster and specially a stack is dangerous and unnecessary) and the sampling is done directly in the function using sf::st_sample. I modified examples that used nndm in _plotgeodist.R and the 4th vignette accordingly.
I also used this PR to push clustered_sample as discussed and to improve the docs in NNDM. Happy to discuss.
Hi Hanna :smile:
I had a look at
sampleFromArea
function within _plotgeodist.R but I didn't dare to modify the inner CRS transformations because I don't fully understand what is going on and I could somehow damageplot_geodist
.The way I solved it is: NNDM (and subsequently kNNDM) now does not depend on
sampleFromArea
anymore, it now only accepts a polygon (same CRS as training points) asmodeldomain
(I think accepting a raster and specially a stack is dangerous and unnecessary) and the sampling is done directly in the function usingsf::st_sample
. I modified examples that usednndm
in _plotgeodist.R and the 4th vignette accordingly.I also used this PR to push
clustered_sample
as discussed and to improve the docs in NNDM. Happy to discuss.