Composite Single Landsat-8 L2 AIKP (ocli.aikp.composite_single.landsat_8)
Example single-product optical composite AIKP for Landsat-8 Collection 2 Level-2 (L2SP / L2SR) imagery.
This AIKP demonstrates how to attach a custom Finder via TaskTemplate.get_finder(cls, task) by binding FinderPlanetaryComputerLANDSAT8, which searches and downloads free Landsat-8 Level-2 products directly from Microsoft Planetary Computer’s public STAC API (with free SAS token signing — no API key or Creodias credentials required).
Module Contents
__init__.py: DefinesTemplate(TemplateCompositeSingle)overridingget_finder(cls, task)to returnFinderPlanetaryComputerLANDSAT8andupdate_recipe(...)to populate visible metadata.config.py: Configuressat_family_name='landsat_8', defaultcomposite_kind='truecolor', and supported composite options (truecolor,infrared,vegetation,urban,water,geo).assemble_recipe.py: Self-containedassemble_kernelfor Landsat-8 Level-2 surface reflectance bands (B1–B7).
Custom Finder Integration (TaskTemplate.get_finder)
When OCLI runs product load, product list, task set master=..., or task get-data, finder_by_task(task) checks Template.get_finder(task) first before falling back to sat_family_name:
from ocli.finders.finder_planetarycomputer_landsat_8 import FinderPlanetaryComputerLANDSAT8
class Template(TemplateCompositeSingle):
@classmethod
def get_finder(cls, task):
return FinderPlanetaryComputerLANDSAT8(
eodata_home=task.get_eodata_home_path(),
cache_dir=task.get_project_cache_path(),
)
Configurable Finder Parameters
Injected automatically into the task config on task create:
Parameter |
Default |
Description |
|---|---|---|
|
1 year ago |
Start of acquisition date window ( |
|
now |
End of acquisition date window ( |
|
|
Maximum cloud cover |
|
|
Optional filter: |
|
|
Optional USGS tier filter: |
|
|
When |
|
|
Maximum number of STAC items to fetch. |
Supported Composites (composite_kind)
|
Red |
Green |
Blue |
Typical Use |
|---|---|---|---|---|
|
B4 |
B3 |
B2 |
Natural color |
|
B5 |
B4 |
B3 |
Color infrared / vegetation vigor |
|
B6 |
B5 |
B2 |
Agriculture / vegetation health |
|
B7 |
B6 |
B4 |
Urban / built-up areas |
|
B5 |
B6 |
B4 |
Land/water delineation |
|
B7 |
B6 |
B2 |
Geology / lithology |
Running the AIKP Workflow
Shell / Bash
# 1. Create and activate a project, then register an ROI
ocli create -n l8_demo -a
ocli roi add -n my_roi /path/to/my_roi.geojson
# 2. Create and activate a task with this AIKP template
ocli task create -t ocli.aikp.composite_single.landsat_8 --roi my_roi -n l8_task --activate
# 3. Configure search filters and composite type
ocli task set composite_kind=truecolor
ocli task set finder.startDate=2024-07-01 finder.completionDate=2024-09-01 finder.cloudCover=20
# 4. Search Planetary Computer STAC API and list discovered Landsat-8 L2 scenes
ocli product load
ocli product list
# 5. Select a scene by 4-char productId (or full title) and download it via SAS-signed HTTPS
ocli task set master=<productId>
ocli task get-data -m --data
# 6. Build the ENVI band stack, create the recipe, assemble, and visualize
ocli task make stack landsat
ocli task make recipe --zone-by-roi --override
ocli ai basic assemble zone
ocli task template visualize zone
# 7. Export COG, GeoJSON, upload, and publish
ocli ai makecog zone
ocli ai makegeojson
ocli ai upload
ocli ai publish post
OCLI REPL
roi add -n Alkmaar_roi --wkt "POLYGON ((4.704098921275971 52.611728011215206, 4.777788540813077 52.611728011215206, 4.777788540813077 52.674045187605685, 4.704098921275971 52.674045187605685, 4.704098921275971 52.611728011215206))"
task create -t ocli.aikp.composite_single.landsat_8 -r Alkmaar_roi -n l8_task -a
task set finder.startDate=2024-07-01 finder.completionDate=2024-09-01 finder.cloudCover=20
product load
product list
task set master=<productId>
task get -m --data
task make stack landsat
task make recipe --zone-by-roi --override
ai basic assemble zone
task template visualize zone