使用 runGdal 下载 MODIS 图像时出错

Error downloading MODIS images using runGdal

大家~

我尝试在 R 中下载我感兴趣的地方的 MODIS 图像,但没有成功,但是,我总是遇到同样的错误。谁能帮帮我?

提前致谢~

代码如下:

> product <- "MOD13Q1"
> h = 26
> v = 4
> getT <- getTile(tileH = 26, tileV = 4)
> runGdal(job = "NDVI", product = product, begin = dates2$beginDOY, end = dates2$endDOY, extent = getT)
No collection specified, getting the newest for MOD13Q1 
########################
outProj          =  asIn 
pixelSize        =  asIn 
resamplingType   =  near 
Output Directory =  D:/NDVI_Processed//Dali 
########################
Downloading structure on 'LAADS' for: MOD13Q1.006
Downloading structure from 'LAADS'-server! Try: 1 
Downloading structure of '0' from 'LAADS'-server.                        

Error in if (FtpDayDirs[1] == FALSE) { : 
  missing value where TRUE/FALSE needed

在这个错误之前,我花了一些时间在rgdal问题上,通过安装OSGeo4W并指定rgdal库解决了这个问题。这是我的会话信息:

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 
[2] LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] MODIS_1.1.2   raster_2.6-7  mapdata_2.3.0 maps_3.3.0    rgdal_1.3-4  
[6] sp_1.3-1     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18    compiler_3.5.1  later_0.7.3     nloptr_1.0.4   
 [5] bitops_1.0-6    class_7.3-14    tools_3.5.1     digest_0.6.16  
 [9] memoise_1.1.0   lattice_0.20-35 shiny_1.1.0     DBI_1.0.0      
[13] parallel_3.5.1  spData_0.2.9.3  e1071_1.7-0     withr_2.1.1    
[17] rgeos_0.3-28    devtools_1.13.6 classInt_0.2-3  mapedit_0.3.2  
[21] grid_3.5.1      sf_0.6-3        R6_2.2.2        ptw_1.9-13     
[25] XML_3.98-1.16   foreign_0.8-70  magrittr_1.5    units_0.6-0    
[29] promises_1.0.1  htmltools_0.3.6 maptools_0.9-3  mime_0.5       
[33] xtable_1.8-3    httpuv_1.4.5    RCurl_1.95-4.11

还有,我的 MODISoptions

> MODISoptions()

STORAGE:
_______________
localArcPath : D:/NDVI/ 
outDirPath   : D:/NDVI_Processed/ 


DOWNLOAD:
_______________
MODISserverOrder : LAADS, LPDAAC 
dlmethod         : auto 
stubbornness     : high 
wait             : 0.5 
quiet            : FALSE 


PROCESSING:
_______________
GDAL           : GDAL 2.2.4, released 2018/03/19 
MRT            : Version 4.1 (March 2011) 
pixelSize      : asIn 
outProj        : asIn 
resamplingType : NN 
dataFormat     : GTiff 

能否使用 MODIS_1.1.3(或更高版本)再试一次,现在可以从 CRAN 获得?该软件包收到了全面更新,特别解决了与从 LADS 和 LP DAAC 下载数据相关的问题(后者需要指定 Earthdata 登录凭据)。使用这个包版本,您的代码可以在我的机器上顺利运行。

library(MODIS)

getT = getTile(tileH = 26, tileV = 4)
tfs = runGdal(job = "NDVI", product = "MOD13Q1", begin = "2000.02.18", end = "2000.03.10", extent = getT)
tfs
# $`MOD13Q1.006`
# $`MOD13Q1.006`$`2000-02-18`
# [1] ".../MODIS_ARC/PROCES~1/NDVI/MOD13Q1.A2000049.250m_16_days_NDVI.tif"                     
# [2] ".../MODIS_ARC/PROCES~1/NDVI/MOD13Q1.A2000049.250m_16_days_EVI.tif"                      
# (etc.)       
# 
# $`MOD13Q1.006`$`2000-03-05`
# [1] ".../MODIS_ARC/PROCES~1/NDVI/MOD13Q1.A2000065.250m_16_days_NDVI.tif"                     
# [2] ".../MODIS_ARC/PROCES~1/NDVI/MOD13Q1.A2000065.250m_16_days_EVI.tif"                      
# (etc.)

另请查看我对以下 SO 问题的回答

其中包含可能与您相关的更多详细信息(此处特意省略以避免重复)。