MyNixOS website logo
Description

Dealing with Multiplatform Satellite Images.

Downloading, customizing, and processing time series of satellite images for a region of interest. 'rsat' functions allow a unified access to multispectral images from Landsat, MODIS and Sentinel repositories. 'rsat' also offers capabilities for customizing satellite images, such as tile mosaicking, image cropping and new variables computation. Finally, 'rsat' covers the processing, including cloud masking, compositing and gap-filling/smoothing time series of images (Militino et al., 2018 <doi:10.3390/rs10030398> and Militino et al., 2019 <doi:10.1109/TGRS.2019.2904193>).

rsat

CRAN version Status at rOpenSci Software Peer Review Lifecycle:maturing Codecov test coverage R build status Total downloads

The goal of rsat is to help you handling time-series of satellite images from multiple platforms in a local, efficient, and standardized way. The package provides tools to;

  1. Search (run vignette("rsat1_search", package = "rsat") command)
  2. Download (run vignette("rsat2_download", package = "rsat") command)
  3. Customize, and (run vignette("rsat3_customize", package = "rsat") command)
  4. Process (run vignette("rsat4_process", package = "rsat") command)

satellite images from Landsat, MODIS, and Sentinel for a region and time of interest.

Installation

You can install the development version from GitHub with:

install.packages(c('usethis', 'pkgdown', 'rcmdcheck', 'rversions', 'urlchecker'))

# check and install devtools
if(!require("devtools")){
   install.packages("devtools")
}
# check and install rmarkdown
if(!require("rmarkdown")){
  install.packages("rmarkdown")
}

devtools::install_github("spatialstatisticsupna/rsat", build_vignettes=TRUE)

Linux

In Linux, you need to install additional libraries before starting with rsat. Use the following commands for:

  • Debian/Ubuntu
sudo apt update 
sudo apt install r-cran-rcpp gdal-bin libgdal-dev libproj-dev openssl libssl-dev xml2 libxml2-dev libmagick++-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libharfbuzz-dev libfribidi-dev
  • RedHat/Fedora
sudo dnf install gdal gdal-devel proj-devel xml2 libxml2-devel libcurl-devel openssl-devel ImageMagick-c++-devel R-devel udunits2-devel sqlite-devel geos-devel pandoc harfbuzz-devel fribidi-devel freetype-devel libpng-devel libtiff-devel libjpeg-devel

Log-in profiles

The registration in the following online portals is required to get a full access to satellite images with rsat;

  • USGS USGS is the sole science agency for the Department of the Interior of United States. Provide access to Modis Images. More information about USGS can be found Here.
  • EarthData: A repository of NASA's earth observation data-sets. More information about EarthData can be found here.
  • DataSpace, a web service giving access to Copernicus' scientific data hub. Please go here to find more details about the data hub.

For convenience, try to use the same username and password for all of them. To satisfy the criteria of all web services make sure that the username is $4$ characters long and includes a period, number or underscore. The password must be $12$ character long and should include characters with at least one capital letter, and numbers.

Example

This is a basic example which shows you how to compute the Normalized Difference Vegetation Index from a MODIS image captured on January 11th, 2020 in northern Spain (Navarre):

library(rsat)

# replace with your own "username" and "password"
set_credentials("username", "password")

# region and time of interest: rtoi
roi <- ex.navarre
toi <- as.Date("2020-01-11")
rtp <- tempdir()

set_database(file.path(tempdir(), "DATABASE"))

navarre <- new_rtoi("Navarre", roi, rtp)

# search, acquire, customize, and process
rsat_search(region = navarre, product = "mod09ga", dates = toi)
rsat_download(navarre)
rsat_mosaic(navarre, overwrite = TRUE)

rsat_derive(navarre, 
            product = "mod09ga", 
            variable = "NDVI")

# plot the results
plot(navarre, "view" , 
      product = "mod09ga", 
      variable = "NDVI", 
      breaks = seq(0, 1, 0.1))
      
plot(navarre,"dates")

See the vignettes for more examples:

browseVignettes("rsat")

Related similar packages

R has become an outstanding tool for remote sensing image analysis. There are several tools for the search and acquisition of satellite images, however, rsat is the first package that standardizes all the procedures in data acquisition to provide an unique workflow for any multispectral satellite.

Currently there are several packages dedicated to remote sensing topic, but they are usually ad-hoc packages for each satellite. Here is a list of some of the most popular R packages dedicated to satellite imagery:

Multi satellite packages

The closest package to rsat is RGISTools. rsat is the redefinition of the RGISTools package reprogrammed from scrach in the object-oriented programming paradigm. Many of the RGISTools code lines have been used to develop rsat, but these have been optimized and redundancies in the code have been removed in order to facilitate its maintenance. In addition, rsat contains new features and R classes to make it more user-friendly.

getSpatialData is another package very similar to rsat. The package has the same philosophy of having a single package for searching and downloading satellite images. However, the development of rsat goes a bit further and in addition to search and download, the package helps you to organize all the downloaded information in a structured database. rsat allows you to use the metadata of the images to see the direct relation with your region of interest before downloading it. Also all image processing standardization is not developed in getSpatialData.

The last package dedicated to image downloading is luna.Searching and downloading images compared to rsat is a bit more complicated. It is only able to search and download Modis and Landsat images, and does not help you in organizing the image products.

Single satellite packages

rLandsat makes it easy to search for Landsat8 product IDs, place an order on USGS-ESPA and download the data. rsat on the other hand is able to do the image search without knowing all the ids, just using a polygon of the region of interest, making the search process much easier.

getlandsat provides access to Landsat 8 metadata and images hosted on AWS S3 at. The package only data for the users, and does not help in further use, as rsat does.

sen2r is an R library which helps to download and preprocess Sentinel-2 optical images. This is done through a GUI, something that can be very interesting for users but limits the analysis of the information prior to downloading, which can be done with rsat.

Raster processing packages

rsat helps you to search, download and pre-process the images, but once these procedures are done it allows you to extract all the processed information into the most used raster classes in R (raster, stars or spatRaster). The image processing packages can be used for further analysis in these R classes.

Contributing

We accept contributions to improve the package. Before contributing, please follow these steps:

  • Contributions should be thoroughly tested with testthat.
  • Code style should attempt to follow the tidyverse style guide.
  • Please attempt to describe what you want to do prior to contributing by submitting an issue.
  • Please follow the typical github fork - pull-request workflow.
  • Make sure you use roxygen and run Check before contributing. More on this front as the package matures.

Citation

citation("rsat")[1]

To cite the package:

U. Pérez-Goya, M. Montesino-SanMartin, A F Militino, M D Ugarte (2021). rsat: Dealing with Multiplatform Satellite Images from Landsat, MODIS, and Sentinel. R package version 0.1.16. https://github.com/ropensci/rsat.

Acknowledgements

This work has been financed by projects MTM2017-82553-R (AEI/FEDER, UE) and PID2020-113125RB-I00/MCIN/AEI/10.13039/501100011033.

Metadata

Version

0.1.21

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows