Is there any way that can be used to parse a shapefile of a country and download MODIS product data within that country using R?
I tried different approaches using the MODIStsp
package (https://docs.ropensci.org/MODIStsp/) as well as the MODISTools
package (https://docs.ropensci.org/MODISTools/articles/modistools-vignette.html) and they both only allow me to download MODIS product data for a defined site, but not a country.
Here's an example of how you might achieve this.
Firstly, download the MODIS data that you require, in this example I'm using MCD12Q1.006
begin_year
andend_year
are in the format: Year.Month.Days.shape_file
is the shapefile you're using, presumably the extent of the shapefile is the country you're after. Though, I'm only going off by the minimal information you have provided.Also, if you require a particular cell size, then you could follow this procedure to get a 5x5 modis cell size.