![](/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.