rss_da_stac 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rss_da_stac-0.1.3/.gitignore +163 -0
- rss_da_stac-0.1.3/.gitlab-ci.yml +61 -0
- rss_da_stac-0.1.3/.pre-commit-config.yaml +36 -0
- rss_da_stac-0.1.3/CHANGELOG.md +29 -0
- rss_da_stac-0.1.3/LICENSE +18 -0
- rss_da_stac-0.1.3/PKG-INFO +35 -0
- rss_da_stac-0.1.3/README.md +20 -0
- rss_da_stac-0.1.3/docs/index.md +218 -0
- rss_da_stac-0.1.3/docs/reference.md +7 -0
- rss_da_stac-0.1.3/mkdocs.yml +16 -0
- rss_da_stac-0.1.3/pylintrc.toml +549 -0
- rss_da_stac-0.1.3/pyproject.toml +53 -0
- rss_da_stac-0.1.3/src/rss_da_stac/__init__.py +59 -0
- rss_da_stac-0.1.3/src/rss_da_stac/_version.py +24 -0
- rss_da_stac-0.1.3/src/rss_da_stac/cli.py +222 -0
- rss_da_stac-0.1.3/src/rss_da_stac/uri2l2a.py +177 -0
- rss_da_stac-0.1.3/src/rss_da_stac/utils.py +828 -0
- rss_da_stac-0.1.3/tests/test_cli.py +19 -0
- rss_da_stac-0.1.3/tests/test_s2stac.py +162 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
public/*
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
*_version.py
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
docs_test/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
# .python-version
|
|
92
|
+
|
|
93
|
+
# pipenv
|
|
94
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
95
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
96
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
97
|
+
# install all needed dependencies.
|
|
98
|
+
#Pipfile.lock
|
|
99
|
+
|
|
100
|
+
# poetry
|
|
101
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
102
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
103
|
+
# commonly ignored for libraries.
|
|
104
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
105
|
+
#poetry.lock
|
|
106
|
+
|
|
107
|
+
# pdm
|
|
108
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
109
|
+
#pdm.lock
|
|
110
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
111
|
+
# in version control.
|
|
112
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
113
|
+
.pdm.toml
|
|
114
|
+
|
|
115
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
116
|
+
__pypackages__/
|
|
117
|
+
|
|
118
|
+
# Celery stuff
|
|
119
|
+
celerybeat-schedule
|
|
120
|
+
celerybeat.pid
|
|
121
|
+
|
|
122
|
+
# SageMath parsed files
|
|
123
|
+
*.sage.py
|
|
124
|
+
|
|
125
|
+
# Environments
|
|
126
|
+
.env
|
|
127
|
+
.venv*
|
|
128
|
+
env/
|
|
129
|
+
venv/
|
|
130
|
+
ENV/
|
|
131
|
+
env.bak/
|
|
132
|
+
venv.bak/
|
|
133
|
+
|
|
134
|
+
# Spyder project settings
|
|
135
|
+
.spyderproject
|
|
136
|
+
.spyproject
|
|
137
|
+
|
|
138
|
+
# Rope project settings
|
|
139
|
+
.ropeproject
|
|
140
|
+
|
|
141
|
+
# mkdocs documentation
|
|
142
|
+
site/
|
|
143
|
+
|
|
144
|
+
# mypy
|
|
145
|
+
.mypy_cache/
|
|
146
|
+
.dmypy.json
|
|
147
|
+
dmypy.json
|
|
148
|
+
|
|
149
|
+
# Pyre type checker
|
|
150
|
+
.pyre/
|
|
151
|
+
|
|
152
|
+
# pytype static type analyzer
|
|
153
|
+
.pytype/
|
|
154
|
+
|
|
155
|
+
# Cython debug symbols
|
|
156
|
+
cython_debug/
|
|
157
|
+
|
|
158
|
+
# PyCharm
|
|
159
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
160
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
161
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
162
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
163
|
+
#.idea/
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
variables:
|
|
2
|
+
UV_VERSION: "0.8"
|
|
3
|
+
PYTHON_VERSION: "3.12"
|
|
4
|
+
BASE_LAYER: bookworm-slim
|
|
5
|
+
# GitLab CI creates a separate mountpoint for the build directory,
|
|
6
|
+
# so we need to copy instead of using hard links.
|
|
7
|
+
UV_LINK_MODE: copy
|
|
8
|
+
|
|
9
|
+
stages:
|
|
10
|
+
- test
|
|
11
|
+
- build
|
|
12
|
+
- build_doc
|
|
13
|
+
- publish
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
default:
|
|
17
|
+
before_script:
|
|
18
|
+
- apt-get update -y
|
|
19
|
+
- apt-get install -y git
|
|
20
|
+
|
|
21
|
+
uv:
|
|
22
|
+
stage: test
|
|
23
|
+
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
|
|
24
|
+
script:
|
|
25
|
+
- uv run pytest
|
|
26
|
+
|
|
27
|
+
build:
|
|
28
|
+
stage: build
|
|
29
|
+
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
|
|
30
|
+
script:
|
|
31
|
+
- uv build
|
|
32
|
+
artifacts:
|
|
33
|
+
paths:
|
|
34
|
+
- dist/
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
pages:
|
|
38
|
+
stage: build_doc
|
|
39
|
+
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
|
|
40
|
+
script:
|
|
41
|
+
- uv run mkdocs build --no-strict --verbose
|
|
42
|
+
artifacts:
|
|
43
|
+
paths:
|
|
44
|
+
- public
|
|
45
|
+
only:
|
|
46
|
+
- main
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
publish:
|
|
50
|
+
stage: publish
|
|
51
|
+
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
|
|
52
|
+
id_tokens:
|
|
53
|
+
PYPI_ID_TOKEN:
|
|
54
|
+
aud: pypi
|
|
55
|
+
dependencies:
|
|
56
|
+
- build
|
|
57
|
+
script:
|
|
58
|
+
- uv publish dist/*.whl dist/*.tar.gz
|
|
59
|
+
rules:
|
|
60
|
+
- if: $CI_COMMIT_TAG
|
|
61
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v4.6.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: end-of-file-fixer
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
args: ["--maxkb=600"]
|
|
10
|
+
|
|
11
|
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
12
|
+
rev: v0.9.5
|
|
13
|
+
hooks:
|
|
14
|
+
- id: ruff
|
|
15
|
+
|
|
16
|
+
# for stuff not currently included in Ruff
|
|
17
|
+
- repo: local
|
|
18
|
+
hooks:
|
|
19
|
+
- id: pylint
|
|
20
|
+
name: pylint
|
|
21
|
+
entry: uv run pylint
|
|
22
|
+
language: system
|
|
23
|
+
types: [python]
|
|
24
|
+
args:
|
|
25
|
+
[
|
|
26
|
+
"-rn", # Only display messages
|
|
27
|
+
"-sn", # Don't display the score
|
|
28
|
+
"--rcfile=pylintrc.toml", # Link to your config file
|
|
29
|
+
"--disable=too-many-positional-arguments"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
33
|
+
# uv version.
|
|
34
|
+
rev: 0.8.15
|
|
35
|
+
hooks:
|
|
36
|
+
- id: uv-lock
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Pre-release
|
|
6
|
+
|
|
7
|
+
## 0.1.1 [2026-03-11]
|
|
8
|
+
### Changed
|
|
9
|
+
- relax the lower bound on typer so the package is easier to install with some other
|
|
10
|
+
packages (in particular, some versions of prefect pin typer to be < 0.16)
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- A function to retrieve the version implemented, so you can now use `rss_da_stac.__version__`
|
|
14
|
+
- `--version` now a callback hook in `rss-stac`
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Some STAC apis now require you to provide at least one collection when searching by item id.
|
|
18
|
+
All the provider sentinel 2 collections are now searched for the id.
|
|
19
|
+
|
|
20
|
+
## 0.1.0 [2026-01-05]
|
|
21
|
+
### Changed
|
|
22
|
+
- comparing geometry now done in pure python. Slightly slower than the shapely approach, but requires fewer packages, and numpy in particular is no longer needed. This should make it lighter and less problematic when using it in conjunction with `rss-da`.
|
|
23
|
+
|
|
24
|
+
- sometimes there can be more than 2 items for a single qvf filename. In this case, we return the best match based on geometry, and in the case of ties, return the one with the most recent creation date. Warning is issued since this shouldn't generally happen, but might occur when
|
|
25
|
+
querying old catalogues.
|
|
26
|
+
|
|
27
|
+
## 0.0.1 [2025-12-11]
|
|
28
|
+
|
|
29
|
+
Initial release.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT No Attribution
|
|
2
|
+
|
|
3
|
+
Copyright 2025 Robert Denham
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
SOFTWARE.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rss_da_stac
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Utilities for JRSRP users to interact with common STAC providers
|
|
5
|
+
Author-email: rdenham <robert.denham@detsi.qld.gov.au>
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: planetary-computer>=1.0.0
|
|
9
|
+
Requires-Dist: pystac-client<0.10.0
|
|
10
|
+
Requires-Dist: pystac>=1.13.0
|
|
11
|
+
Requires-Dist: pytz>=2025.2
|
|
12
|
+
Requires-Dist: tifftools>=1.6.1
|
|
13
|
+
Requires-Dist: typer>=0.15.0
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# `rss_da_stac` - Python utilities for interacting with common STAC providers
|
|
17
|
+
|
|
18
|
+
Remote Sensing Scientists associated with the [JRSRP](https://www.jrsrp.org.au/)
|
|
19
|
+
have several established work practices that have been developed over many years,
|
|
20
|
+
and predate STAC and cloud-native Earth Observation (EO) data.
|
|
21
|
+
|
|
22
|
+
This package is designed To help integrate
|
|
23
|
+
their current work approaches with modern data providers via STAC. Of particular
|
|
24
|
+
interest is the interoperability of the [`qvf`](https://jrsrp.gitlab.io/sys/meta_info/)
|
|
25
|
+
name convention and how that relates to STAC. Several utilities are designed
|
|
26
|
+
to work with `qvf` style names, such as
|
|
27
|
+
|
|
28
|
+
* `qvf2item`: Convert one or more QVF files to a STAC ItemCollection
|
|
29
|
+
* `item2qvf`: Given a stac item or itemcollection, provide the equivalent qvf compliant name for each item.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
see [notes](docs/index.md) for details on the included scripts and the API.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# `rss_da_stac` - Python utilities for interacting with common STAC providers
|
|
2
|
+
|
|
3
|
+
Remote Sensing Scientists associated with the [JRSRP](https://www.jrsrp.org.au/)
|
|
4
|
+
have several established work practices that have been developed over many years,
|
|
5
|
+
and predate STAC and cloud-native Earth Observation (EO) data.
|
|
6
|
+
|
|
7
|
+
This package is designed To help integrate
|
|
8
|
+
their current work approaches with modern data providers via STAC. Of particular
|
|
9
|
+
interest is the interoperability of the [`qvf`](https://jrsrp.gitlab.io/sys/meta_info/)
|
|
10
|
+
name convention and how that relates to STAC. Several utilities are designed
|
|
11
|
+
to work with `qvf` style names, such as
|
|
12
|
+
|
|
13
|
+
* `qvf2item`: Convert one or more QVF files to a STAC ItemCollection
|
|
14
|
+
* `item2qvf`: Given a stac item or itemcollection, provide the equivalent qvf compliant name for each item.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
see [notes](docs/index.md) for details on the included scripts and the API.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# `rss_da_stac`: - Python utilities for interacting with STAC and Sentinel2
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## CLI
|
|
6
|
+
|
|
7
|
+
Several commands are available:
|
|
8
|
+
|
|
9
|
+
### `qvf2item`
|
|
10
|
+
|
|
11
|
+
Designed so that if you have a qvf name, you can get an equivalent STAC Item, from one of the
|
|
12
|
+
main providers. For example
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
rss-stac qvf2item cfmsre_t56kkv_20221223_adbm6.tif
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Default provider is element84.
|
|
19
|
+
|
|
20
|
+
If there are multiple potential items, you will get multiple results, so you might want to
|
|
21
|
+
take care here. For example:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
rss-stac qvf2item cfmsre_t53krt_20250705_ab0m3.img|jq '.features[].id'
|
|
25
|
+
|
|
26
|
+
#"S2B_T53KRT_20250705T010237_L2A"
|
|
27
|
+
#"S2B_T53KRT_20250705T010107_L2A"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The only reliable way I could work out to get a specific capture is to compare the
|
|
31
|
+
geometry to a reference. For example, if you did a query on our in house database,
|
|
32
|
+
you might get:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
rss querydatabase --separator='\t' --raw --sql "select ST_AsGeoJSON(geom) from sentinel2_list where qvf_sa
|
|
36
|
+
t = 'cf' and scene = 't53krt' and date='20250705'"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{"type":"Polygon","coordinates":[[[137.88287585319,-20.8637683840933],[137.864516174824,-19.872835815401],[138.911431015994,-19.8534526589396],[138.936450904658,-20.84276283712],[137.88287585319,-20.8637683840933]]]}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
rss-stac qvf2item cfmsre_t53krt_20250705_ab0m3.img \
|
|
45
|
+
--geom '{"type":"Polygon","coordinates":[[[137.88287585319,-20.8637683840933],[137.864516174824,-19.872835815401],[138.911431015994,-19.8534526589396],[138.936450904658,-20.84276283712],[137.88287585319,-20.8637683840933]]]}'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
should return just the item with id `S2B_T53KRT_20250705T010237_L2A`.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
You can provide alterntive providers:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
rss-stac qvf2item --provider CDSE cfmsre_t56kkv_20221223_adbm6.tif|jq '.features[].id'
|
|
55
|
+
#"S2B_MSIL2A_20221223T001109_N0510_R073_T56KKV_20240803T180510"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For recent images, you'd expect the L1C option from CDSE to match ours:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
rss-stac qvf2item cfmsre_t53krt_20250705_ab0m3.img --level l1c --provider CDSE --geom '{"type":"Polygon","c
|
|
62
|
+
oordinates":[[[137.88287585319,-20.8637683840933],[137.864516174824,-19.872835815401],[138.911431015994,-19.8534526589396],[138.
|
|
63
|
+
936450904658,-20.84276283712],[137.88287585319,-20.8637683840933]]]}'|jq '.features[].id'
|
|
64
|
+
"S2B_MSIL1C_20250705T005709_N0511_R002_T53KRT_20250705T021954"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
rss querydatabase --separator='\t' --raw --sql "select esa_id from sentinel2_list where qvf_sat = 'cf' and scene = 't53krt' and date='20250705'"
|
|
69
|
+
# S2B_MSIL1C_20250705T005709_N0511_R002_T53KRT_20250705T021954
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
It will also accept multiple input names:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
rss-stac qvf2item cfmsre_t53krt_20250705_ab0m3.img cemsre_t50jll_20201227_abam0.json|jq -r '.features[].id'
|
|
80
|
+
#S2B_T53KRT_20250705T010237_L2A
|
|
81
|
+
#S2B_T53KRT_20250705T010107_L2A
|
|
82
|
+
#S2A_T50JLL_20201227T021851_L2A
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or using a listfile:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
cat <<EOF > listfile.txt
|
|
89
|
+
cfmsre_t53krt_20250705_ab0m3.img
|
|
90
|
+
cemsre_t50jll_20201227_abam0.json
|
|
91
|
+
EOF
|
|
92
|
+
|
|
93
|
+
rss-stac qvf2item --file listfile.txt |jq -r '.features[].id'
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
Currently can use CDSE, planetary-ccomputer or element84.
|
|
98
|
+
|
|
99
|
+
Default collection is S2L2A, but you can also get S2L1C
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
rss-stac qvf2item --level l1c --provider CDSE cfmsre_t56kkv_20221223_adbm6.tif|jq '.features[].id'
|
|
103
|
+
#"S2B_MSIL1C_20221223T001109_N0510_R073_T56KKV_20240803T130258"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `item2item`
|
|
107
|
+
|
|
108
|
+
Convert an item from one provider to another.
|
|
109
|
+
|
|
110
|
+
For example, if you have a CDSE item, and you'd like the equivalent from element84:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
rss-stac qvf2item --level l1c --provider CDSE cfmsre_t56kkv_20221223_adbm6.tif| \
|
|
114
|
+
rss-stac item2item |jq '.features[].id'
|
|
115
|
+
|
|
116
|
+
#"S2B_56KKV_20221223_0_L1C"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
When there are potentially 2 items that match the same date, satellite, tile, we use
|
|
120
|
+
the same geometry comparison as in the `qvf_to_stac` routine.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### `item2qvf`
|
|
126
|
+
|
|
127
|
+
Given an item, work out the qvf name
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
rss-stac qvf2item --level l1c --provider CDSE cfmsre_t56kkv_20221223_adbm6.tif| \
|
|
131
|
+
rss-stac item2qvf
|
|
132
|
+
# should return the same name as you started
|
|
133
|
+
# cfmsre_t56kkv_20221223_adbm6.tif
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Same issue with multiple candidates:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
rss-stac qvf2item cfmsre_t53krt_20250705_ab0m3.img|rss-stac item2qvf
|
|
140
|
+
|
|
141
|
+
# cfmsre_t53krt_20250705_adbm3.tif
|
|
142
|
+
# cfmsre_t53krt_20250705_adbm3.tif
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## `relevel`
|
|
146
|
+
|
|
147
|
+
If you have a S2L1C and you'd like the S2L2A equivalent:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
rss-stac qvf2item --level l1c --provider CDSE cfmsre_t56kkv_20221223_adbm6.tif|
|
|
151
|
+
rss-stac relevel |jq '.features[].id'
|
|
152
|
+
|
|
153
|
+
# "S2B_MSIL2A_20221223T001109_N0510_R073_T56KKV_20240803T180510"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## `histitem`
|
|
157
|
+
|
|
158
|
+
Some of our files have the STAC item embedded in the metadata. If you have a file
|
|
159
|
+
like this, you can extract the item:
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
rss recall cfmsre_t56kkv_20221223_adbm6.tif
|
|
163
|
+
rss-stac histitem cfmsre_t56kkv_20221223_adbm6.tif| jq '.id'
|
|
164
|
+
|
|
165
|
+
# S2B_T56KKV_20221223T001108_L2A
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Note that this command returns a single item. Other commands return an ItemCollection,
|
|
169
|
+
even if the collection has a single item.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## `cat`
|
|
173
|
+
|
|
174
|
+
Sometimes you might want to concatenate items, collections. You can do this like
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
rss-stac qvf2item cfmsre_t53krt_20250705_ab0m3.img > item1.json
|
|
178
|
+
rss-stac qvf2item cemsre_t50jll_20201227_abam0.json > item2.json
|
|
179
|
+
|
|
180
|
+
rss-stac cat item1.json item2.json |jq -r '.features[].id'
|
|
181
|
+
|
|
182
|
+
# S2B_T53KRT_20250705T010237_L2A
|
|
183
|
+
# S2B_T53KRT_20250705T010107_L2A
|
|
184
|
+
# S2A_T50JLL_20201227T021851_L2A
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
## Other miscellaneous commands
|
|
189
|
+
|
|
190
|
+
I've also added a script that is a little bit specialised so I didn't put it in
|
|
191
|
+
with the other apps:
|
|
192
|
+
|
|
193
|
+
```sh
|
|
194
|
+
uri2l2a --help
|
|
195
|
+
|
|
196
|
+
Usage: uri2l2a [OPTIONS] [URIS]...
|
|
197
|
+
|
|
198
|
+
given s1c esa ids, convert to s2l2a and change provider to element84
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Basic idea is that it will take a product id, like
|
|
203
|
+
`S2B_MSIL1C_20250917T003659_N0511_R059_T54KZV_20250917T043259`
|
|
204
|
+
and provide a STAC item from L2A element84.
|
|
205
|
+
|
|
206
|
+
This is aimed at replacing the `qvf2stac`, since `qvfname` isn't
|
|
207
|
+
always a 1:1 match to STAC items. This way should be.
|
|
208
|
+
|
|
209
|
+
example:
|
|
210
|
+
|
|
211
|
+
```sh
|
|
212
|
+
uv run uri2l2a S2B_MSIL1C_20250917T003659_N0511_R059_T54KZV_20250917T043259|jq '.features[].id'
|
|
213
|
+
#2B_T54KZV_20250917T004315_L2A
|
|
214
|
+
|
|
215
|
+
uv run uri2l2a S2B_MSIL1C_20250917T003659_N0511_R059_T54KZV_20250917T043259 --provider cdse|jq '.features[].id'
|
|
216
|
+
#S2B_MSIL2A_20250917T003659_N0511_R059_T54KZV_20250917T044524
|
|
217
|
+
```
|
|
218
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
site_name: Remote Sensing Sciences - `rss_da_stac` for working with Sentinel 2 STAC
|
|
2
|
+
site_author: JRSRP
|
|
3
|
+
site_url: https://jrsrp.gitlab.io/sys/stac/rss_da_stac/
|
|
4
|
+
site_dir: public
|
|
5
|
+
repo_url: https://jrsrp.gitlab.io/sys/stac/rss_da_stac/
|
|
6
|
+
docs_dir: 'docs'
|
|
7
|
+
|
|
8
|
+
theme:
|
|
9
|
+
name: "material"
|
|
10
|
+
|
|
11
|
+
plugins:
|
|
12
|
+
- mkdocstrings
|
|
13
|
+
|
|
14
|
+
nav:
|
|
15
|
+
- index.md
|
|
16
|
+
- reference.md
|