GRASS logo

NAME

r.in.landsat - Downloads and imports Landsat Collection 2 Level-2 (surface reflectance + surface temperature) imagery using the cubo library via Microsoft Planetary Computer.

KEYWORDS

Import, imagery, satellite, Landsat, temperature, download, STAC, Planetary Computer, cloud

SYNOPSIS

r.in.landsat
r.in.landsat --help
r.in.landsat [-clpr] [collection=string] [bands=string[,string,...]] start=string end=string [resolution=integer] [clouds=integer] [platform=string] [output=string] [stac=string] [strds=string] [--help] [--verbose] [--quiet] [--ui]

Flags:

-c
Null out cloud/cloud-shadow pixels using the qa_pixel QA band (auto-added if not listed)
-l
List available dates/scenes and exit without downloading
-p
Print region info and exit
-r
Create true-color RGB composite with r.composite after import (auto-adds red, green, blue if not listed)
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

collection=string
STAC collection ID (Planetary Computer)
Default: landsat-c2-l2
bands=string[,string,...]
Bands to download (Planetary Computer asset names). coastal/blue/green/red/nir08/swir16/swir22 map to OLI bands 1-7; lwir11 is the atmospherically-corrected Surface Temperature band (K); qa_pixel is the bitmask cloud/shadow/snow/water QA band.
Default: coastal,blue,green,red,nir08,swir16,swir22,lwir11,qa_pixel
start=string [required]
Start date (YYYY-MM-DD)
end=string [required]
End date (YYYY-MM-DD)
resolution=integer
Spatial resolution in meters
Default: 30
clouds=integer
Maximum cloud cover percentage [0, 100]
platform=string
Restrict to a specific Landsat platform, or any (Landsat 8+9 Collection 2 share the same band/asset naming used here)
Options: any, landsat-8, landsat-9, landsat-7, landsat-5, landsat-4
Default: any
output=string
Prefix for output raster map names
Default: landsat
stac=string
STAC endpoint URL
Default: https://planetarycomputer.microsoft.com/api/stac/v1
strds=string
Prefix for Space-Time Raster Dataset names (one STRDS per band, e.g. strds=l8 → l8_red, l8_lwir11 …)

Table of contents

DESCRIPTION

r.in.landsat downloads Landsat Collection 2 Level-2 imagery (surface reflectance + surface temperature) directly into the current GRASS GIS project using the cubo Python library, from Microsoft Planetary Computer (no credentials required). Each acquisition date is imported as individual raster maps and grouped with i.group, following the same pattern as r.in.sentinel.

g.region n=0.52 s=0.48 e=33.34 w=33.28 res=30

r.in.landsat start=2025-01-01 end=2025-07-01 clouds=70 \
  output=l8 -c strds=l8

Bands

Default bands are the Planetary Computer landsat-c2-l2 asset names: coastal, blue, green, red, nir08, swir16, swir22 (surface reflectance, OLI bands 1-7), lwir11 (surface temperature, already atmospherically corrected - no separate LST retrieval needed), and qa_pixel (bitmask QA band).

Physical units

Unlike r.in.sentinel (which leaves Sentinel-2 as raw DN, since its STAC metadata carries no scale/offset transform), bands here arrive already in physical units: reflectance bands as [0-1] and lwir11 as Kelvin. Planetary Computer’s landsat-c2-l2 STAC items carry the USGS Collection 2 Level 2 scale/offset as raster:bands metadata, and cubo/stackstac applies it while building the cube - no additional rescaling is done (or needed) by this module. qa_pixel is left as an integer bitmask.

Cloud masking

The c flag nulls out pixels where QA_PIXEL bit 3 (cloud) or bit 4 (cloud shadow) is set, in every band for that date (auto-adds qa_pixel to the band list if not already requested).

Output naming

Raster maps are named {output}_{YYYYMMDD}_{band}, e.g. l8_20250222_lwir11. One i.group per acquisition date: {output}_{YYYYMMDD}.

Space-Time Raster Dataset (STRDS)

Pass strds=prefix to additionally register one STRDS per band ({prefix}_{band}, e.g. l8_red, l8_lwir11). Only maps confirmed to exist in the current project after import are registered - a band that failed to import for a given date is silently excluded from its STRDS rather than breaking t.register for the whole run.

NOTES

Landsat 8/9 revisit is 16 days each (8 days combined, since both share the landsat-c2-l2 collection) - expect far sparser dates than Sentinel-1/2 over the same period.

SEE ALSO

r.in.sentinel, i.albedo, i.emissivity, i.eb.netrad, i.eb.soilheatflux, i.eb.hsebal95, i.eb.evapfr, i.biomass

AUTHOR

Yann Chemin

SOURCE CODE

Available at: r.in.landsat source code (history)

Accessed: Monday Jul 27 12:29:36 2026


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual