RGISTools (version 1.0.2)

modSearch: Search MODIS images

Description

modSearch searches MODIS images in the NASA Common Metadata Repository (CMR) concerning a particular location and date interval. The function returns a character vector with the names of the images and their uniform resource locators (URLs)

Usage

modSearch(product, collection = 6, verbose = FALSE, ...)

Arguments

product

the short name of the MODIS product.

collection

MODIS collection. By default, 6.

verbose

logical argument. If TRUE, the function prints the running steps and warnings.

...

arguments for nested functions:

  • dates a vector with the capturing dates being searched. This argument is mandatory if startDate and endDate are not defined.

  • startDate a Date class object with the starting date of the study period. This argument is mandatory if dates is not defined.

  • endDate a Date class object with the ending date of the study period. This argument is mandatory if dates is not defined.

  • region a Spatial*, projected raster*, or sf class object defining the area of interest. This argument is mandatory if extent or lonlat are not defined.

  • lonlat a vector with the longitude/latitude coordinates of the point of interest. This argument is mandatory if region or extent are not defined.

  • extent an extent, Raster*, or Spatial* object representing the region of interest with longitude/latitude coordinates. This argument is mandatory if region or lonlat are not defined.

Value

a vector with the url for image downloading.

Details

modSearch uses the NASA Common Metadata Repository (CMR) powered API. The catalogue of MODIS products can be found here. The catalogue shows the product short names and provides detailed information about the product. By the time `RGISTools' is released, NASA carries out the maintenance of its website on Wednesdays, which may cause an error when connecting to their server. You can get your `EarthData' credentials here.

The function can be used to retrieve the web address of the preview (resType = "browseurl") or the actual image (resType = "url"). By default, the URL points towards the actual image.

Examples

Run this code
# NOT RUN {
# load a spatial polygon object of Navarre with longitude/latitude coordinates
data(ex.navarre)
# searching MODIS MYD13A2 images between 2011 and 2013 by longitude/latitude
# using a polygon class variable
sres <- modSearch(product = "MYD13A2",
                  startDate = as.Date("01-01-2011", "%d-%m-%Y"),
                  endDate = as.Date("31-12-2013", "%d-%m-%Y"),
                  collection = 6,
                  extent = ex.navarre)
# region of interest: defined based on longitude/latitude extent
# searching MODIS MYD13A2 images in 2010 by longitude/latitude
# using a extent class variable defined by the user
aoi = extent(c(-2.49, -0.72, 41.91, 43.31))
sres <- modSearch(product = "MYD13A2",
                  startDate = as.Date("01-01-2010", "%d-%m-%Y"),
                  endDate = as.Date("31-12-2010", "%d-%m-%Y"),
                  collection = 6,
                  extent = aoi)
head(sres)
# }

Run the code above in your browser using DataLab