Modisfast
Fast and efficient access to MODIS, VIIRS and GPM Earth Observation data with R
Install / Use
/learn @ptaconet/ModisfastREADME
modisfast <a href="https://github.com/ptaconet/modisfast"><img src="man/figures/logo.png" align="right" height="138" /></a>
<!-- <img src="man/figures/logo.png" align="right" /> --> <!-- badges: start --> <!-- [](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/ptaconet/modisfast) --> <!-- [](https://doi.org/10.5281/zenodo.12772739) --> <!-- badges: end -->Table of contents
<p align="left">• <a href="#overview">Overview</a><br> • <a href="#installation">Installation</a><br> • <a href="#get-started">Get started</a><br> • <a href="#collections-available-in-modisfast">Data collections available</a><br> • <a href="#manual-testing-of-the-functionality">Manual testing of the functionality</a><br> • <a href="#foundational-framework">Foundational framework</a><br> • <a href="#comparison-with-similar-r-packages">Comparison with similar R packages</a><br> • <a href="#citation">Citation</a><br> • <a href="#future-developments">Future developments</a><br> • <a href="#contributing">Contributing</a><br> • <a href="#acknowledgments">Acknowledgments</a><br>
</p>News
2025-09-17 : IMPORTANT NOTIFICATION : Due to major recent migrations
of NASA’s servers (details
here),
modisfast will be temporarily unavailable in the coming months. Work
is in progress to connect modisfast to the new NASA OPeNDAP servers.
Overview
modisfast is an R package designed for easy and fast
downloads of
MODIS Land
products,
VIIRS Land
products, and GPM (Global Precipitation
Measurement Mission) Earth Observation data.
modisfast uses the abilities offered by the
OPeNDAP framework (Open-source
Project for a Network Data Access Protocol) to download a subset of
Earth Observation data cube, along spatial, temporal or any other data
dimension (depth, …). This way, it reduces downloading time and disk
usage to their minimum : no more 1° x 1° MODIS tiles with 10 bands when
your region of interest is only 30 km x 30 km wide and you need 2 bands
! Moreover, modisfast enables parallel downloads of data.
This package is hence particularly suited for retrieving MODIS or VIIRS data over long time series and over areas, rather than short time series and points.
Importantly, the robust, sustainable, and cost-free foundational
framework of modisfast, both for the data
provider (NASA) and the software (R, OPeNDAP, the tidyverse and GDAL
suite of packages and software), guarantees the long-term reliability
and open-source nature of the package.
By enabling to download subsets of data cubes, modisfast facilites the
access to Earth science data for R users in places where internet
connection is slow or expensive and promotes digital sobriety for our
research work.
Installation
You can install the released version of modisfast from
CRAN with :
install.packages("modisfast")
or the development version (to get a bug fix or to use a feature from the development version) with :
if(!require(devtools)){install.packages("devtools")}
devtools::install_github("ptaconet/modisfast")
Get Started
Accessing and opening MODIS data with modisfast is a simple 3-steps
workflow. This example shows how to download and import a one-year-long
monthly time series of MODIS Normalized Difference Vegetation Index
(NDVI) at 1 km spatial resolution over the whole country of Madagascar.
1/ First, define the variables of interest (ROI, time frame, collection, and bands) :
# Load the packages
library(modisfast)
library(sf)
library(terra)
# ROI and time range of interest
roi <- st_as_sf(data.frame(id = "madagascar", geom = "POLYGON((41.95 -11.37,51.26 -11.37,51.26 -26.17,41.95 -26.17,41.95 -11.37))"), wkt = "geom", crs = 4326) # a ROI of interest, format sf polygon
time_range <- as.Date(c("2023-01-01", "2023-12-31")) # a time range of interest
# MODIS collections and variables (bands) of interest
collection <- "MOD13A3.061" # run mf_list_collections() for an exhaustive list of collections available
variables <- c("_1_km_monthly_NDVI") # run mf_list_variables("MOD13A3.061") for an exhaustive list of variables available for the collection "MOD13A3.061"
2/ Then, get the URL of the data and download them :
## Login to Earthdata servers with your EOSDIS credentials.
# To create an account (free) go to : https://urs.earthdata.nasa.gov/.
log <- mf_login(credentials = c("username", "password")) # set your own EOSDIS username and password
## Get the URLs of the data
urls <- mf_get_url(
collection = collection,
variables = variables,
roi = roi,
time_range = time_range
)
## Download the data. By default the data is downloaded in a temporary directory, but you can specify a folder
res_dl <- mf_download_data(urls, parallel = TRUE)
3/ And finally, import the data in R as a terra::SpatRaster object
using the function mf_import_data() ( :warning: see
here
why you should use this function, instead of the original
terra::rast(), in the context of modisfast) :
r <- mf_import_data(
path = dirname(res_dl$destfile[1]),
collection = collection,
proj_epsg = 4326
)
terra::plot(r, col = rev(terrain.colors(20)))
<figure>
<img src=".Rplot_readme.png"
alt="Time series of monthly 1-km MODIS NDVI over Madagascar for the year 2023, retrieved with modisfast" />
<figcaption aria-hidden="true">Time series of monthly 1-km MODIS NDVI
over Madagascar for the year 2023, retrieved with
<code>modisfast</code></figcaption>
</figure>
et voilà !
Want more examples ? modisfast provides three long-form documentations
and examples to learn more about the package :
- a “Get started” article describing the core features of the package;
- a “Get data on several regions or periods of interest simultaneously”
article
detailing advanced functionalities of
modisfast(for multi-time frame or multi-regions data access); - a “Full use case” article showcasing an example of use of the package in a scientific context (here: landscape epidemiology).
Collections available in modisfast
Currently modisfast supports download of 69 data collections,
extracted from the following meta-collections :
- MODIS land products made available by the [NASA / USGS LP DAAC](https://
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
