Find the files covering your area and dates, and create URLs to download only the selected bands and area. Use [mf_download_data()] to download them.
mf_get_url(
collection,
variables = NULL,
roi,
time_range,
collection_id = NULL,
verbose = "inform"
)Collection identifier, e.g. `"MOD11A1.061"`, `"VNP43MA4.002"` or `"GPM_3IMERGDF.07"`.
One or more band names to retrieve, as returned by [mf_list_variables()].
An `sf` polygon with an `id` column.
One date or two bounding dates.
Optional Earthdata Cloud collection ID. Usually leave this empty; the package finds it in its collection catalogue. Not used for GPM.
Character string: `"quiet"`, `"inform"` (default), or `"debug"`. Controls progress messages; `"debug"` also shows request details.
A data frame with the download URLs for [mf_download_data()].
Set `EARTHDATA_TOKEN` to your Earthdata token before calling this function.
if (FALSE) { # \dontrun{
Sys.setenv(EARTHDATA_TOKEN = "your Earthdata bearer token")
roi <- sf::st_as_sf(data.frame(id = "test", geom =
"POLYGON ((3.8 43.5, 4 43.5, 4 43.7, 3.8 43.7, 3.8 43.5))"),
wkt = "geom", crs = 4326)
time_range <- as.Date(c("2026-01-01", "2026-01-30"))
urls_vj121a2 <- mf_get_url("VJ121A2.002",
c("LST_Day_1KM", "LST_Night_1KM"), roi, time_range)
mf_download_data(urls_vj121a2)
} # }