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

Bbox issue #118

Open
nephentes7 opened this issue Aug 3, 2022 · 0 comments
Open

Bbox issue #118

nephentes7 opened this issue Aug 3, 2022 · 0 comments

Comments

@nephentes7
Copy link

nephentes7 commented Aug 3, 2022

I am trying to run spsample, using country boundaries as spatial object (x).
However, I need sample points/and grid covering a slighly larger AOI (of e.g. kind of buffering), using the same cellsize (to get overlapping points).
Thus, I have changed only the bbox, creating a new matrix as below (nm2).
However, the results, (points2) does not 'cover' the new bbox. Why? Maybe I am missing something...THANKS

"bb: bounding box of the sample domain; setting this to a smaller value leads to sub-region sampling"

points1 <- spsample(study_area, type = "hexagonal", cellsize = size)
points2 <- spsample(study_area, type = "hexagonal", bb= bbox(nm2), cellsize = size)


size <- 0.179
#original bbox of study area
minori <- c(-11.485695, 4.352916)
maxori <- c(-7.365113, 8.551790)
m <- cbind(minori, maxori)
rnameso <- c("x","y")
cnameso <- c("min", "max")
nm <- matrix(m,nrow=2,byrow=FALSE,dimnames=list(rnameso,cnameso))
nm

#new bbox ('buffering')
min <- c(-13.485695, 6.352916)
max <- c(-9.365113, 10.551790)

m2 <- cbind(min, max)
rnames <- c("x","y")
cnames <- c("min", "max")
nm2 <- matrix(m2,nrow=2,byrow=FALSE,dimnames=list(rnames,cnames))
nm2

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

1 participant