![](/img/trans.png)
[英]R - sum of the values of points in different tiles (polygons) of a Voronoi diagram
[英]Sentinel-1 & 2: create coincident points in images of different tiles
我有一个 Sentinel-1 图像和 Sentinel-2 图像,我想让 Sentinel-1 中的像素与 Sentinel-2 重合。 更简单的解决方案是使用S2 <- resample(S2, S1)
将两个图像放在相同的几何形状(空间范围和分辨率)中,但我担心光谱信息的完整性。 更好地重新采样 Sentinel-1 或 Sentinel-2, bilinear
对于雷达(S1)或最近的邻居更好?
在我的例子中:
# Packages
library(raster)
# Sentinel 1 and 2 samples
S1_sample <- stack("https://github.com/Leprechault/trash/raw/main/AguaSumida_PR001_1_2016-06-29_20160615_6_97EE.tif")
S1_sample
class : RasterStack
dimensions : 200, 200, 40000, 5 (nrow, ncol, ncell, nlayers)
resolution : 10, 10 (x, y)
extent : 445099.9, 447099.9, 7779496, 7781496 (xmin, xmax, ymin, ymax)
crs : +proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs
names : vv, vh, RVI, RATIO, RFDI
min values : -22.5303173, -31.3865096, 1.7272604, 0.7599905, -0.6713753
max values : -2.9259523, -8.6576518, 3.3427506, 5.0859694, 0.1363698
S2_sample <-stack("https://github.com/Leprechault/trash/raw/main/AguaSumida_PR001_1_2019-08-06_20190801_T22KDC.tif")
S2_sample
class : RasterStack
dimensions : 201, 200, 40200, 4 (nrow, ncol, ncell, nlayers)
resolution : 10, 10 (x, y)
extent : 445100, 447100, 7779490, 7781500 (xmin, xmax, ymin, ymax)
crs : +proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs
names : B2, B3, B4, B8
# Plotting
par(mfrow=c(1,2))
plotRGB(S1_sample, r = 3, g = 2, b = 1, stretch = "lin")
plotRGB(S2_sample, r = 3, g = 2, b = 1, stretch = "lin")
#
最终目标是在 Sentinel-2 的相同像素中提取 Sentinel-1 的值,包括 NA(有时我的图像在其中一个传感器中被裁剪)。 请帮我。 提前致谢。
示例数据
library(terra)
S1 <- rast("https://github.com/Leprechault/trash/raw/main/AguaSumida_PR001_1_2016-06-29_20160615_6_97EE.tif")
S2 <- rast("https://github.com/Leprechault/trash/raw/main/AguaSumida_PR001_1_2019-08-06_20190801_T22KDC.tif")
plot(S2, 1, legend=FALSE)
plot(S1, 1, add=TRUE, legend=FALSE, alpha=.5)
你的问题不是很清楚,但我认为你正在寻找这样的东西:
S2 <- resample(S2, S1)
现在S1
和S2
具有相同的几何形状(空间范围和分辨率)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.