プロット ウィンドウのサイズを変更すると、奇妙な動作に気付きました。検討
library(sp)
library(rgeos)
library(raster)
rst.test <- raster(nrows=300, ncols=300, xmn=-150, xmx=150, ymn=-150, ymx=150, crs="NA")
sap.krog300 <- SpatialPoints(coordinates(matrix(c(0,0), ncol = 2)))
sap.krog300 <- gBuffer(spgeom = sap.krog300, width = 100, quadsegs = 20)
shrunk <- gBuffer(spgeom = sap.krog300, width = -30)
shrunk <- rasterize(x = shrunk, y = rst.test)
shrunk.coords <- xyFromCell(object = rst.test, cell = which(shrunk[] == 1))
plot(shrunk)
points(shrunk.coords, pch = "+")
ウィンドウのサイズを変更すると、プロットされたポイントは、下にあるラスターとは異なる範囲になります。ウィンドウとプロットのサイズを変更すると、プロットはうまくshrunk
いきますshrunk.coords
。誰でもこれを説明できますか?