MODIS tiles and projection
Raster containing MODIS tile ID's
getModisTiles(x, tiles) crsModis getModisRaster() getDegreeRaster()
x
: A spatial object which modis tiles will cover.tiles
: A raster with modis (or other) tiles.Provides information on tiles which can be downloaded from MODIS.
https://modis-land.gsfc.nasa.gov/MODLAND_grid.html, https://spatialreference.org/ref/esri/54008/
getModisTiles
returns a matrix with modis tiles.
getModisRaster
shows horizontal and vertical tile names for downloading data from MODIS.
getDegreeRaster
shows horizontal and vertical tiles in long-lat, for downloading elevation.
crsModis myPointLL = vect(cbind(c(5:6),10:11), crs = crsLL) getModisTiles(myPointLL) getModisTiles(myPointLL, getDegreeRaster()) modisUrl = 'https://e4ftl01.cr.usgs.gov/MOTA/MCD12Q1.061/2002.01.01/' desiredTiles = paste0("(", paste(getModisTiles(myPointLL, getModisRaster())[,'tile'], collapse='|'), ").*.hdf$") if(requireNamespace("RCurl", quietly=TRUE) & requireNamespace("XML", quietly=TRUE)) { allFiles = try(XML::getHTMLLinks(RCurl::getURL( modisUrl,ftp.use.epsv=FALSE, dirlistonly = TRUE)), silent=TRUE) if(!identical(class(allFiles), 'try-error')) { theFiles = grep(desiredTiles, allFiles, value=TRUE) paste0(modisUrl, theFiles) } }
Useful links