Skip to content

stactools-packages/sentinel2

Repository files navigation

stactools-sentinel2

stactools package for Sentinel-2 data.

Examples

Running

pip install stactools-sentinel2

SAFE archive:

stac sentinel2 create-item tests/data-files/S2A_MSIL2A_20190212T192651_N0212_R013_T07HFE_20201007T160857.SAFE output/

AWS Open Data bucket sentinel-s2-l2a:

stac sentinel2 create-item tests/data-files/S2A_OPER_MSI_L2A_TL_SGS__20181231T210250_A018414_T10SDG output/

Sentinel Hub metadata:

stac sentinel2 create-item --asset-href-prefix s3://sentinel-s2-l2a/tiles/34/L/BP/2022/4/1/0/ \
      https://roda.sentinel-hub.com/sentinel-s2-l2a/tiles/34/L/BP/2022/4/1/0/ output

Note: this does not currently work with S3 buckets using requester-pays.

The flag --tolerance can be set to a decimal value to define the simplification tolerance of the Item geometry. This is a pass-through to the Shapely simplify method.

Development

Install pre-commit hooks with:

pre-commit install

Run these pre-commit hooks with:

pre-commit run --all-files

Install the code in the local python env so your IDE can see it:

pip install -e ".[dev]"

Testing

Run the tests with:

pytest -vvv

Most tests fixture expectations can be updated by running:

pytest --update-expectations

If the expectation file is missing for any test in test_commands it will be generated, and the test will fail. This failure is to ensure fixture updates don't happen silently.

Alternatively, tests can be updated by using the following command:

python scripts/create_expected.py

About

stactools package for Sentinel-2

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 13