r-spatialecology/landscapemetrics

sample_lsm issue

Closed this issue · 3 comments

Hi,
I am using a landcover image and points processed from GEE. The coordinate system is the same in both inputs. Once I used this:
square_shdi = sample_lsm(ivory,
points = sample_points2,
size = 100,
what = "lsm_l_shdi")

I got this:
Error in lapply(X = raster::as.list(landscape), FUN = sample_lsm_int, :
argument "y" is missing, with no default

Not sure what the problem really is. I thought it was because some points were outside of image margins, but it is not the case. Not sure if this is the correct place to leave these comments.

Thanks

Paulo J.

Hey Paulo,

Here is the perfect place for this comment :)

Because the sample_lsm()-function can also handle lines and polygons for sampling, we changed the argument points and it is now called y to be more generic.

Please try the following and let me know if it work

square_shdi <- sample_lsm(ivory, y= sample_points2, size = 100, what = "lsm_l_shdi")

Thank you!
I was using an old tutorial...now it works perfectly. I am transitioning from R to GEE. Is there any future attempt of having this library in javascript for GEE?

👍

No, there are no plans for GEE, sorry.

I will close this issue for now. Feel free to reopen at any time if necessaire.