Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to create something like a regular spatial distribution with NLMR? #82

Open
bniebuhr opened this issue Nov 30, 2021 · 2 comments

Comments

@bniebuhr
Copy link

Hello,

I am exploring different spatial patterns as simulated scenarios and I was wondering if it is possible to have a regularly spaced pattern with NLMR. Maybe something like multiple focii regularly spaced among each other, with the intensity of the values decreasing as we go far from the centers. This is common in spatial point patterns but it would be nice to have raster representations of that.

Even though regular distributions might not be so common in nature, they might be for anthropogenic infrastructure (e.g. a representation of a wind park with regularly spaced wind tubines), so I see usefullness on that...

Any ideas or suggestions on that?

@marcosci
Copy link
Collaborator

😄 Hi there!

Any chance that you have a visual aid of what you aim to achieve? I can't actually make a picture in my head from what you want.

Could it be that you want to merge nlm_curds with a gradient or mpd?

@bniebuhr
Copy link
Author

Hi!

Sorry for not giving a clear example earlier.
Here it is an example, see if this makes sense to you.

library(raster)
library(landscapetools)
library(dplyr)

# create regular points
r <- raster::raster(xmn = 0, xmx = 100,
                    ymn = 0, ymx = 100, 
                    resolution = 10)
pts <- as.data.frame(r, xy = TRUE)[1:2]

# rasterize points
res(r) <- 1
r_pts <- raster::rasterize(pts, r, field = 1)

# plot points
landscapetools::show_landscape(r_pts)

# create pattern, e.g. gaussian neighborhood analysis
gf <- raster::focalWeight(r, 2, "Gauss")
nlm_regular <- raster::focal(r_pts, w = gf, na.rm = TRUE, pad = TRUE) %>% 
  raster::calc(fun = function(x) x/max(x)) # rescale

# plot "neutral" regular landscape
landscapetools::show_landscape(nlm_regular)

image

Maybe it violates the idea of a "neutral landscape model" - the only thing that could vary in this case is the number or density of points. But in some cases I see it might be useful to have such spatial patterns to compare theoretical results with those of random or clumped landscapes, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants