我正在尝试使用MODIStsp
R 包下载指定国家/地区的数据。为此,我从这里下载了蒙古的边界到我的工作目录中,并将它的路径传递到我的MODIStsp()
函数中。但是,这似乎并没有在定义的边界内下载数据并继续下载初始示例
spatial_file <- "C:/Users/Zstar/mongolia_administrative_boundaries_national_polygon.shp"
MODIStsp(gui = FALSE,
out_folder = "Data",
out_folder_mod = "Data",
selprod = "Vegetation_Indexes_16Days_1Km (M*D13A2)",
spafile = spatial_file,
bandsel = "NDVI",
quality_bandsel = "QA_usef",
indexes_bandsel = "SR",
user = "mstp_test" ,
password = "MSTP_test_01",
start_date = "2020.06.01",
end_date = "2020.06.15",
verbose = FALSE)
library(raster)
library(here)
library(ggplot2)
raster <- raster(here("Data/VI_16Days_1Km_v6/NDVI/MOD13A2_NDVI_2020_161.tif"))
df <- as.data.frame(raster, xy = TRUE, na.rm = TRUE)
ggplot(data = df,
aes(x=x,y=y)) +
geom_raster(aes(fill = MOD13A2_NDVI_2020_161))