Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.74 KB

README.md

File metadata and controls

56 lines (40 loc) · 1.74 KB

Binder

stactools-nalcms

This package is intended to help describe the North American Land Change Monitoring System (NALCMS) data hosted by the Commission for Environmental Cooperation (CEC) as STAC.

Usage

  1. As a Python module
from stactools.nalcms import stac
from stactools.nalcms.constants import PERIODS, GSDS, REGIONS, YEARS
import os
import itertools as it

# Create the STAC
root_col = stac.create_nalcms_collection()

for per, years in PERIODS.items():
    combos = it.product(REGIONS.keys(), GSDS, years)
    period = stac.create_period_collection(per)
    root_col.add_child(period)

    for reg, gsd, year in combos:
        item = stac.create_item(reg, gsd, year, "")
        if item is not None:
            period.add_item(item)

# Create a specific STAC Item
item = stac.create_item("CAN", "30", "2010", source="path/to/cog.tif")
  1. Using the CLI
scripts/stac nalcms create-collection -d ./examples/

scripts/stac nalcms create-item -d ./examples/

scripts/stac nalcms create-cog -s ./examples/image.tif -d ./examples/

Use scripts/stac nalcms --help to see all subcommands and options.