Skip to content

stactools-packages/glad-global-forest-change

Repository files navigation

stactools-glad-global-forest-change

PyPI GitHub Workflow Status (with event)

STAC examples

Installation

pip install stactools-glad-global-forest-change

Command-line usage

By default, stactools-glad-global-forest-change will assume that you are generating STAC metadata for the original files which are stored in a Google storage container and publicly available over HTTP.

stac gladglobalforestchange create-collection {destination}

stac gladglobalforestchange create-item \
  https://storage.googleapis.com/earthenginepartners-hansen/GFC-2023-v1.11/Hansen_GFC-2023-v1.11_gain_40N_080W.tif \
  https://storage.googleapis.com/earthenginepartners-hansen/GFC-2023-v1.11/Hansen_GFC-2023-v1.11_treecover2000_40N_080W.tif \
  https://storage.googleapis.com/earthenginepartners-hansen/GFC-2023-v1.11/Hansen_GFC-2023-v1.11_lossyear_40N_080W.tif \
  https://storage.googleapis.com/earthenginepartners-hansen/GFC-2023-v1.11/Hansen_GFC-2023-v1.11_datamask_40N_080W.tif \
  /tmp/item.json    

Warning

These files are not cloud-optimized geotiffs (COGs)! Be aware that this has major performance implications for applications that consume the data from these assets. Consider creating a copy of the files in the COG format and providing the --cogs flag to indicate that the assets are COGs.

Use stac gladglobalforestchange --help to see all subcommands and options.

Create COGs

The original files hosted on the Google Earth Engine are not cloud-optimized geotiffs (COGs). This is a problem for many applications so we added the create-cogs function to convert the underlying assets to COGs and copy them to a new storage location (either a local directory or an S3 bucket).

stac gladglobalforestchange create-cogs {assets} {destination} 

Contributing

We use pre-commit to check any changes. To set up your development environment:

uv sync
uv run pre-commit install

To check all files:

uv run pre-commit run --all-files

To run the tests:

uv run pytest -vv

If you've updated the STAC metadata output, update the examples:

uv run scripts/update-examples

About

stactools package for the GLAD Global Forest Change dataset

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published