I am trying to download Modis NDVI and EVI images. I have used the following R-code:
setwd("/home/karthik/Valmiki/Modis_bands/")
library(raster)
library(RCurl)
source("ModisDownload.R") ##ModisDownload.R is in the setwd directory#
X="MOD13Q1"
getMODIS(x=X, h=25, v=6, dates = c('2000.02.18', '2014.07.31'), version='005')
I am getting the following error:
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file 'ModisLP.RData', probable reason 'No such file or directory'
I am using Ubuntu 12.04. Please let me know me where I am going wrong.
Best Answer
Here is a quick workaround using the MODIS package:
If you don't want to extract certain SDS layers, but deal with the raw .hdf files instead, simply use
getHdf
instead ofrunGdal
and drop 'SDSstring'.