{"id":13791284,"url":"https://github.com/e-sensing/sits","last_synced_at":"2026-01-17T17:38:21.767Z","repository":{"id":38706664,"uuid":"98539507","full_name":"e-sensing/sits","owner":"e-sensing","description":"Satellite image time series in R","archived":false,"fork":false,"pushed_at":"2026-01-12T18:01:11.000Z","size":292537,"stargazers_count":521,"open_issues_count":19,"forks_count":86,"subscribers_count":26,"default_branch":"master","last_synced_at":"2026-01-12T19:59:17.066Z","etag":null,"topics":["big-earth-data","cbers","earth-observation","eo-datacubes","geospatial","image-time-series","land-cover-classification","landsat","planetary-computer","r-spatial","remote-sensing","rspatial","satellite-image-time-series","satellite-imagery","sentinel-2","stac-api","stac-catalog"],"latest_commit_sha":null,"homepage":"https://e-sensing.github.io/sitsbook/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e-sensing.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-27T13:32:40.000Z","updated_at":"2026-01-09T22:40:10.000Z","dependencies_parsed_at":"2023-09-21T19:46:26.032Z","dependency_job_id":"6004ee19-2ed5-4140-bfcc-02e650abff8d","html_url":"https://github.com/e-sensing/sits","commit_stats":{"total_commits":4804,"total_committers":30,"mean_commits":"160.13333333333333","dds":0.6598667776852623,"last_synced_commit":"32d058c9e1a1b0b4818a7f926001f9a710fee258"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/e-sensing/sits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-sensing%2Fsits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-sensing%2Fsits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-sensing%2Fsits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-sensing%2Fsits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e-sensing","download_url":"https://codeload.github.com/e-sensing/sits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-sensing%2Fsits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28513775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["big-earth-data","cbers","earth-observation","eo-datacubes","geospatial","image-time-series","land-cover-classification","landsat","planetary-computer","r-spatial","remote-sensing","rspatial","satellite-image-time-series","satellite-imagery","sentinel-2","stac-api","stac-catalog"],"created_at":"2024-08-03T22:00:58.283Z","updated_at":"2026-01-17T17:38:21.756Z","avatar_url":"https://github.com/e-sensing.png","language":"R","funding_links":[],"categories":["Natural Resources","Applications","R"],"sub_categories":["Soil and Land","Remote Sensing"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo=FALSE}\nknitr::opts_chunk$set(\n    collapse = TRUE,\n    comment = \"#\u003e\",\n    fig.path = \"man/figures/README-\"\n)\n# set seed for reproducibility\nset.seed(4242)\ntorch::torch_manual_seed(1234)\n```\n\n# SITS - Satellite Image Time Series Analysis for Earth Observation Data Cubes \u003cimg src=\"man/figures/sits_sticker.png\" align=\"right\" width=\"150\" alt=\"SITS icon\" /\u003e\n\n\u003c!-- badges: start --\u003e\n\n\u003c!-- [![Build Status](https://drone.dpi.inpe.br/api/badges/e-sensing/sits/status.svg)](https://drone.dpi.inpe.br/e-sensing/sits) --\u003e\n[![Status at rOpenSci Software Peer Review](https://badges.ropensci.org/596_status.svg)](https://github.com/ropensci/software-review/issues/596)\n[![CRAN status](https://www.r-pkg.org/badges/version/sits)](https://cran.r-project.org/package=sits)\n[![R-check-dev](https://github.com/e-sensing/sits/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/e-sensing/sits/actions/workflows/R-CMD-check.yaml)\n[![Codecov](https://codecov.io/gh/e-sensing/sits/branch/dev/graph/badge.svg?token=hZxdJgKGcE)](https://app.codecov.io/gh/e-sensing/sits)\n[![Documentation](https://img.shields.io/badge/docs-online-blueviolet)](https://e-sensing.github.io/sitsbook/)\n[![Life cycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![Software License](https://img.shields.io/badge/license-GPL--2-green)](https://github.com/e-sensing/sits/blob/master/LICENSE)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\n`sits` is an open source R/Python package for satellite image time series analysis. The package is developed in R and provides full access to its functions with a Python API. It enables users to apply machine learning techniques for classifying image time series obtained from earth observation data cubes. The basic workflow in  `sits` is:\n\n1. Select an image collection from cloud providers AWS, Brazil Data Cube, Digital Earth Africa, Copernicus Data Space Ecosystem, Digital Earth Australia, Microsoft Planetary Computer, NASA Harmonized Landsat/Sentinel, Open Geo Hub, and Swiss Data Cube. \n2. Build a regular data cube from analysis-ready image collections.\n3. Merge data cube from multisource analysis (e.g., Sentinel-1 with Sentinel-2).\n3. Extract labelled time series from data cubes to be used as training samples.\n4. Perform samples quality control using self-organised maps.\n5. Train machine learning and deep learning models.\n6. Tune deep learning models for improved accuracy.\n7. Classify data cubes using machine learning and deep learning models, with GPU support if available.\n8. Run spatial-temporal segmentation methods for object-based time series classification.\n9. Post-process classified images with Bayesian smoothing to remove outliers. \n10. Estimate uncertainty values of classified images.\n11. Evaluate classification accuracy using best practices.\n12. Improve results with active learning and self-supervised learning methods.\n\n```{r sits, echo=FALSE, out.width=\"60%\", out.height=\"60%\", fig.align=\"center\", fig.cap=\"Conceptual view of data cubes (source: authors)\"}\nknitr::include_graphics(\"man/figures/sits_general_view.jpg\")\n```\n\n\n## Documentation \n\nDetailed documentation on how to use `sits` is available in the e-book [\"Satellite Image Time Series Analysis on Earth Observation Data Cubes\"](https://e-sensing.github.io/sitsbook/).\n\nCode documentation on the `sits` functions is available in the [pkgdown format](https://e-sensing.github.io/sits/).\n\n## Installation\n\n### Pre-Requisites\n\nSince the `sits` package is developed in `R`, to run it you need an R environment on which you install the `R` version of `sits`. After that, users can optionally install the Python API interface as described below.\n\n### Obtaining `sits` in R\n\nAfter installing the latest version of `R` from the [CRAN archive](https://cran.r-project.org/), `sits` can also be installed from CRAN: \n\n```{r, eval=FALSE}\ninstall.packages(\"sits\", dependencies = TRUE)\n```\n\nThe latest supported version is available on github. It may have additional fixes from the version available from CRAN. \n\n```{r, eval=FALSE}\ndevtools::install_github(\"e-sensing/sits\", dependencies = TRUE)\n```\n\n```{r}\n# load the sits library\nlibrary(sits)\n```\n\n### Configuring the Python environment\n\nThe Python interface for sits is as a wrapper around the R implementation. It gives Python users access to the all features of the sits package. To use `sits` in Python, one needs Python 3.10 or higher. After installing the R version of `sits`, please also install the `arrow` R package. \n\nThe Python API for `sits` is available on `PyPi`, and can be installed as follows:\n\n```{sh, eval = FALSE}\npip install pysits\n```\n\nPlease follow the examples of the [SITS book](https://e-sensing.github.io/sitsbook/) for examples of Python usage.\n\n\n\n### Support for GPU \n\nFor users working with deep learning models, `sits` supports GPU acceleration through the [torch](https://torch.mlverse.org/docs/) package, which is already included as a dependency when you install `sits`. This provides significant performance improvements for deep learning operations. The `torch` package automatically detects available GPUs and utilizes them when possible, requiring no additional configuration in most cases.\n\n## Building Earth Observation Data Cubes\n\n### Image Collections Accessible by `sits`\n\nUsers create data cubes from analysis-ready data (ARD) image collections available in cloud services. The collections accessible in `sits` `r packageVersion(\"sits\")` are:\n\n- Brazil Data Cube - [BDC](https://data.inpe.br/bdc/en/home-page-2/): Open data collections of Sentinel-2, Landsat-8 and CBERS-4 images.\n- Copernicus Data Space Environment [CDSE](https://dataspace.copernicus.eu/): Open data collections from the EU Copernicus programme.\n- Earth on AWS - [AWS](https://aws.amazon.com/earth/): Sentinel-2/2A level 2A collections. \n- Digital Earth Africa - [DEAFRICA](https://digitalearthafrica.org/en_za/): Open data collection of Sentinel-2/2A and Landsat-8 for Africa.\n- Digital Earth Australia - [DEAUSTRALIA](https://www.ga.gov.au/scientific-topics/dea): Open data collections for the Australian subcontinent.\n- Microsoft Planetary Computer - [MPC](https://planetarycomputer.microsoft.com/catalog): Open data collection of Sentinel-2/2A and Landsat-8.\n- NASA Harmonized Landsat/Sentinel Collection [HLS](https://hls.gsfc.nasa.gov/).\n- Open Geo Hub Harmonized Landsat-5/7/8 Collection at [OGH](https://stac.openlandmap.org/landsat_glad.swa.ard2_bimonthly/collection.json).\n- Swiss Data Cube ([SDC](https://www.swissdatacube.org/)): Open data collection of Sentinel-2/2A and Landsat-8.\n- [USGS](https://landsatlook.usgs.gov/stac-browser): Landsat-4/5/7/8 collections, which are not open data.\n\nOpen data collections do not require payment of access fees. Except for those in the Brazil Data Cube, these collections are not regular. Irregular collections require further processing before they can be used for classification using machine learning models.\n\n### Building a Data Cube from an ARD Image Collection\n\nThe following code defines an irregular data cube of Sentinel-2/2A images available in the Microsoft Planetary Computer, using the open data collection `\"SENTINEL-2-L2A\"`.  The geographical area of the data cube is defined by the tiles `\"20LKP\"` and `\"20LLKP\"`, and the temporal extent by a start and end date.  Access to other cloud services works in similar ways. \n\n```{r, tidy = \"styler\", echo=TRUE}\ns2_cube \u003c- sits_cube(\n    source = \"MPC\",\n    collection = \"SENTINEL-2-L2A\",\n    tiles = c(\"20LKP\", \"20LLP\"),\n    bands = c(\"B03\", \"B08\", \"B11\", \"SCL\"),\n    start_date = as.Date(\"2018-07-01\"),\n    end_date = as.Date(\"2019-06-30\"),\n    progress = FALSE\n)\n```\n\nThis cube is irregular. The timelines of tiles `\"20LKP\"` and `\"20LLKP\"` and the resolutions of the bands are different. Sentinel-2 bands `\"B03\"` and `\"B08\"` have 10-meters resolution, while band `\"B11\"` and the cloud band `\"SCL\"` have 20-meters resolution. Irregular collections need an additional processing step to be converted to regular data cubes, as described below.\n\n```{r dcconcept, echo=FALSE, out.width=\"90%\", out.height=\"90%\", fig.align=\"center\", fig.cap=\"Conceptual view of data cubes (source: authors)\"}\nknitr::include_graphics(\"man/figures/datacube_conception.jpg\")\n```\n\nAfter defining an irregular ARD image collection from a cloud service using `sits_cube()`, users should run `sits_regularize()` to build a regular data cube. This function uses the [gdalcubes R package](https://github.com/appelmar/gdalcubes). \n\n\n```{r, tidy = \"styler\", eval=FALSE, echo=TRUE}\ngc_cube \u003c- sits_regularize(\n    cube          = s2_cube,\n    output_dir    = tempdir(),\n    period        = \"P15D\",\n    res           = 60,\n    multicores    = 4\n)\n```\nThe above command builds a regular data cube with all bands interpolated to 60 m spatial resolution and 15-days temporal resolution. Regular data cubes are the input to the `sits` functions for time series retrieval, building machine learning models, and classification of raster images and time series.\n\n## Working with Time Series in `sits`\n\n### Accessing Time Series in Data Cubes\n\n`sits` has been designed to use satellite image time series to derive machine  learning models. After the data cube has been created, time series can be retrieved individually or by using CSV or SHP files, as in the following example. The example below uses a data cube in a local directory, whose images have been obtained from the `\"MOD13Q1-6\"` collection of the Brazil Data Cube.\n\n```{r, tidy = \"styler\", eval=TRUE, echo=TRUE, cache=TRUE} \nlibrary(sits)\n# this data cube uses images from the Brazil Data Cube that have\n# downloaded to a local directory\ndata_dir \u003c- system.file(\"extdata/raster/mod13q1\", package = \"sits\")\n# create a cube from downloaded files\nraster_cube \u003c- sits_cube(\n    source = \"BDC\",\n    collection = \"MOD13Q1-6.1\",\n    data_dir = data_dir,\n    delim = \"_\",\n    parse_info = c(\"X1\", \"X2\", \"tile\", \"band\", \"date\"),\n    progress = FALSE\n)\n# obtain a set of samples defined by a CSV file\ncsv_file \u003c- system.file(\"extdata/samples/samples_sinop_crop.csv\",\n    package = \"sits\"\n)\n# retrieve the time series associated with the samples from the data cube\npoints \u003c- sits_get_data(raster_cube, samples = csv_file)\n# show the time series\npoints[1:3, ]\n```\n\nAfter a time series has been obtained, it is loaded in a tibble. The first six columns contain the metadata: spatial and temporal location, label assigned to the sample, and coverage from where the data has been extracted. The spatial location is given in longitude and latitude coordinates. The first sample has been labelled \"Pasture\", at location (-55.65931, -11.76267), and is considered valid for the period (2013-09-14, 2014-08-29). \n\n## Time Series Classification \n\n### Training Machine Learning Models\n\n`sits` provides support for the classification of both individual time\nseries as well as data cubes. The following machine learning methods are\navailable in `sits`:\n\n-   Support vector machines (`sits_svm()`)\n-   Random forests (`sits_rfor()`)\n-   Extreme gradient boosting (`sits_xgboost()`)\n-   Multi-layer perceptrons (`sits_mlp()`)\n-   1D convolution neural networks (`sits_tempcnn()`)\n-   Residual neural networks (`sits_resnet()`)\n-   Temporal self-attention encoder (`sits_tae()`) \n-   Lightweight temporal attention encoder (`sits_lighttae()`)\n\nThe following example illustrate how to train a dataset and classify an\nindividual time series. First we use the `sits_train()` function with two\nparameters: the training dataset (described above) and the chosen\nmachine learning model (in this case, Random Forest). \nThe trained model is then used to classify a time series from Mato Grosso\nBrazilian state, using `sits_classify()`. The results can be shown in text\nformat using the function `sits_show_prediction()` or graphically using\n`plot`.\n\n```{r, tidy = \"styler\", fig.align=\"center\", fig.height=3.5, fig.width=7, fig.cap=\"Classification of NDVI time series using Random Forest\", cache=TRUE}\n# training data set\ndata(\"samples_modis_ndvi\")\n# point to be classified\ndata(\"point_mt_6bands\")\n# Train a random forest model\nrfor_model \u003c- sits_train(\n    samples = samples_modis_ndvi,\n    ml_method = sits_rfor()\n)\n# Select NDVI band of the point to be classified\n# Classify using TempCNN model\n# Plot the result\npoint_mt_6bands |\u003e\n    sits_select(bands = \"NDVI\") |\u003e\n    sits_classify(rfor_model) |\u003e\n    plot()\n```\n\nThe following example shows how to classify a data cube organized as a\nset of raster images. The result can also be visualized interactively \nusing `sits_view()`. \n\n```{r, tidy = \"styler\", fig.align=\"center\", fig.height=4.5, fig.width=9, fig.cap=\"Land use and Land cover in Sinop, MT, Brazil in 2018\", cache=TRUE}\n# Create a data cube to be classified\n# Cube is composed of MOD13Q1 images from the Sinop region in Mato Grosso (Brazil)\ndata_dir \u003c- system.file(\"extdata/raster/mod13q1\", package = \"sits\")\nsinop \u003c- sits_cube(\n    source = \"BDC\",\n    collection = \"MOD13Q1-6.1\",\n    data_dir = data_dir,\n    delim = \"_\",\n    parse_info = c(\"X1\", \"X2\", \"tile\", \"band\", \"date\"),\n    progress = FALSE\n)\n# Classify the raster cube, generating a probability file\n# Filter the pixels in the cube to remove noise\nprobs_cube \u003c- sits_classify(\n    data = sinop,\n    ml_model = rfor_model,\n    output_dir = tempdir()\n)\n# apply a bayesian smoothing to remove outliers\nbayes_cube \u003c- sits_smooth(\n    cube = probs_cube,\n    output_dir = tempdir()\n)\n# generate a thematic map\nlabel_cube \u003c- sits_label_classification(\n    cube = bayes_cube,\n    output_dir = tempdir()\n)\n# plot the the labelled cube\nplot(label_cube)\n```\n\n\n### References\n\n#### Citable papers for sits\n\nIf you use `sits`, please cite the following paper:\n\n- Rolf Simoes, Gilberto Camara, Gilberto Queiroz, Felipe Souza, Pedro R. Andrade,  Lorena Santos, Alexandre Carvalho, and Karine Ferreira. “Satellite Image Time Series Analysis for Big Earth Observation Data”. Remote Sensing, 13: 2428, 2021. \u003cdoi:10.3390/rs13132428\u003e. \n\nAdditionally, the sample quality control methods that use self-organized maps are described in the following reference:\n\n- Lorena Santos, Karine Ferreira, Gilberto Camara, Michelle Picoli, Rolf Simoes, “Quality control and class noise reduction of satellite image time series”. ISPRS Journal of Photogrammetry and Remote Sensing, 177:75-88, 2021. \u003cdoi:10.1016/j.isprsjprs.2021.04.014\u003e.\n\n### Acknowledgements for community support\n\nThe authors are thankful for the contributions of Edzer Pebesma, Jakub Nowosad. Marius Appel, Martin Tennekes, Robert Hijmans, Ron Wehrens, and Tim Appelhans, respectively chief developers of the packages `sf`/`stars`, `supercells`, `gdalcubes`, `tmap`, `terra`, `kohonen`, and  `leafem`. We are grateful for the work of Dirk Eddelbuettel on `Rcpp` and `RcppArmadillo`.  The `sits` package recognises the great work of the RStudio team, including the `tidyverse`. Many thanks to Daniel Falbel for his great work in the `torch` and `luz` packages. Charlotte Pelletier shared the python code that has been reused for the TempCNN machine learning model. We would like to thank Maja Schneider for sharing the python code that helped the implementation of the `sits_lighttae()` and `sits_tae()` model. We recognize the importance of the work by Chris Holmes and Mattias Mohr on the STAC specification and API. \n\n### Acknowledgements for Financial and Material Support\n\nWe acknowledge and thank the project funders that provided financial and material support:\n\n- Amazon Fund, established by the Brazilian government with financial contribution from Norway, through the project contract between the Brazilian Development Bank (BNDES) and the Foundation for Science, Technology and Space Applications (FUNCATE), for the establishment of the Brazil Data Cube,  process 17.2.0536.1. \n\n- Coordenação de Aperfeiçoamento de Pessoal de Nível Superior-Brasil (CAPES) and from the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq), for providing MSc and PhD scholarships. \n\n- Sao Paulo Research Foundation (FAPESP) under eScience Program grant 2014/08398-6, for for providing MSc, PhD and post-doc scholarships, equipment, and travel support.  \n\n- International Climate Initiative of the Germany Federal Ministry for the Environment, Nature Conservation, Building and Nuclear Safety (IKI) under grant 17-III-084- Global-A-RESTORE+ (“RESTORE+: Addressing Landscape Restoration on Degraded Land in Indonesia and Brazil”). \n\n- Microsoft Planetary Computer under the GEO-Microsoft Cloud Computer Grants Programme.\n\n- Instituto Clima e Sociedade, under the project grant \"Modernization of PRODES and DETER Amazon monitoring systems\". \n\n- The Open-Earth-Monitor Cyberinfrastructure project, which has received funding from the European Union's Horizon Europe research and innovation programme under [grant agreement No. 101059548](https://cordis.europa.eu/project/id/101059548). \n\n- [FAO-EOSTAT](https://www.fao.org/in-action/eostat) initiative, which uses next generation Earth observation tools to produce land cover and land use statistics.\n\n### How to contribute\n\nThe `sits` project is released with a [Contributor Code of Conduct](https://github.com/e-sensing/sits/blob/master/CODE_OF_CONDUCT.md).\nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-sensing%2Fsits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe-sensing%2Fsits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-sensing%2Fsits/lists"}