eotdl 2025.3.25__tar.gz → 2025.4.2.post2__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.
- eotdl-2025.4.2.post2/.gitignore +43 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/PKG-INFO +14 -32
- eotdl-2025.4.2.post2/eotdl/__init__.py +1 -0
- eotdl-2025.4.2.post2/eotdl/access/__init__.py +17 -0
- eotdl-2025.4.2.post2/eotdl/access/download.py +97 -0
- eotdl-2025.4.2.post2/eotdl/access/search.py +52 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/sentinelhub/__init__.py +6 -2
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/sentinelhub/client.py +9 -8
- eotdl-2025.4.2.post2/eotdl/access/sentinelhub/evalscripts.py +398 -0
- eotdl-2025.4.2.post2/eotdl/access/sentinelhub/parameters.py +167 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/sentinelhub/utils.py +55 -20
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/curation/stac/stac.py +1 -1
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/datasets/__init__.py +1 -1
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/datasets/ingest.py +9 -2
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/datasets/stage.py +5 -5
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/files/ingest.py +17 -11
- eotdl-2025.4.2.post2/eotdl/models/download.py +101 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/models/ingest.py +11 -3
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/models/stage.py +4 -1
- eotdl-2025.4.2.post2/eotdl/repos/DatasetsAPIRepo.py +43 -0
- eotdl-2025.4.2.post2/eotdl/repos/FilesAPIRepo.py +103 -0
- eotdl-2025.4.2.post2/eotdl/repos/ModelsAPIRepo.py +41 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/repos/STACAPIRepo.py +0 -1
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/time_utils.py +3 -3
- eotdl-2025.4.2.post2/eotdl.png +0 -0
- eotdl-2025.4.2.post2/main.py +5 -0
- eotdl-2025.4.2.post2/pyproject.toml +30 -0
- eotdl-2025.4.2.post2/pyproject.toml.bck +35 -0
- eotdl-2025.4.2.post2/tests/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/_test_access.py +24 -0
- eotdl-2025.4.2.post2/tests/_test_hello.py +6 -0
- eotdl-2025.4.2.post2/tests/unit/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/unit/_test_auth.py +97 -0
- eotdl-2025.4.2.post2/tests/unit/access/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/unit/curation/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/fixtures.py +76 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac/catalog.json +18 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac/sentinel-2-l2a/Jaca_1/Jaca_1.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac/sentinel-2-l2a/Jaca_2/Jaca_2.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac/sentinel-2-l2a/Jaca_3/Jaca_3.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac/sentinel-2-l2a/Jaca_4/Jaca_4.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac/sentinel-2-l2a/collection.json +59 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/catalog.json +23 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/labels/Jaca_1/Jaca_1.json +98 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/labels/Jaca_2/Jaca_2.json +98 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/labels/Jaca_3/Jaca_3.json +98 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/labels/Jaca_4/Jaca_4.json +98 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/labels/collection.json +77 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/sentinel-2-l2a/Jaca_1/Jaca_1.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/sentinel-2-l2a/Jaca_2/Jaca_2.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/sentinel-2-l2a/Jaca_3/Jaca_3.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/sentinel-2-l2a/Jaca_4/Jaca_4.json +222 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/jaca_dataset_stac_labels/sentinel-2-l2a/collection.json +59 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/labels_scaneo/Jaca_1_labels.geojson +1 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/labels_scaneo/Jaca_2_labels.geojson +1 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/labels_scaneo/Jaca_3_labels.geojson +1 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/labels_scaneo/Jaca_4_labels.geojson +1 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/labels_scaneo/labels.json +1 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/sentinel_2/Boadella_2020-01-13.tif +0 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/sentinel_2/Boadella_2020-01-13_labels.geojson +1 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/sentinel_2/Boadella_2020-01-28.tif +0 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_data/sentinel_2/Boadella_2020-02-02_labels.geojson +6255 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_dataframe.py +39 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_extent.py +33 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_labels.py +37 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_ml_dataset.py +96 -0
- eotdl-2025.4.2.post2/tests/unit/curation/stac/test_stac.py +89 -0
- eotdl-2025.4.2.post2/tests/unit/datasets/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/unit/datasets/_test_datasets.py +114 -0
- eotdl-2025.4.2.post2/tests/unit/datasets/_test_download_dataset.py +19 -0
- eotdl-2025.4.2.post2/tests/unit/datasets/_test_retrieve_datasets.py +117 -0
- eotdl-2025.4.2.post2/tests/unit/tools/__init__.py +0 -0
- eotdl-2025.4.2.post2/tests/unit/tools/test_geo_utils.py +132 -0
- eotdl-2025.4.2.post2/tests/unit/tools/test_metadata.py +50 -0
- eotdl-2025.4.2.post2/tests/unit/tools/test_paths.py +40 -0
- eotdl-2025.4.2.post2/tests/unit/tools/test_time_utils.py +107 -0
- eotdl-2025.4.2.post2/tests/unit/tools/test_tools.py +6 -0
- eotdl-2025.4.2.post2/uv.lock +614 -0
- eotdl-2025.3.25/eotdl/__init__.py +0 -1
- eotdl-2025.3.25/eotdl/access/__init__.py +0 -7
- eotdl-2025.3.25/eotdl/access/download.py +0 -63
- eotdl-2025.3.25/eotdl/access/search.py +0 -24
- eotdl-2025.3.25/eotdl/access/sentinelhub/evalscripts.py +0 -132
- eotdl-2025.3.25/eotdl/access/sentinelhub/parameters.py +0 -89
- eotdl-2025.3.25/eotdl/repos/DatasetsAPIRepo.py +0 -93
- eotdl-2025.3.25/eotdl/repos/FilesAPIRepo.py +0 -293
- eotdl-2025.3.25/eotdl/repos/ModelsAPIRepo.py +0 -80
- eotdl-2025.3.25/pyproject.toml +0 -43
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/README.md +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/airbus/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/airbus/client.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/airbus/parameters.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/access/airbus/utils.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/auth/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/auth/auth.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/auth/errors.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/auth/is_logged.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/auth/logout.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/cli.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/commands/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/commands/auth.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/commands/datasets.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/commands/models.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/commands/stac.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/curation/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/curation/stac/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/curation/stac/api.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/datasets/retrieve.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/datasets/update.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/files/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/files/ingest.bck +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/files/metadata.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/models/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/models/retrieve.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/models/update.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/repos/APIRepo.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/repos/AuthAPIRepo.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/repos/AuthRepo.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/repos/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/shared/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/shared/checksum.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/geo_utils.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/metadata.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/paths.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/stac.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/tools/tools.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/wrappers/__init__.py +0 -0
- {eotdl-2025.3.25 → eotdl-2025.4.2.post2}/eotdl/wrappers/models.py +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
__pycache__
|
2
|
+
.pytest_cache
|
3
|
+
dist
|
4
|
+
.DS_Store
|
5
|
+
node_modules
|
6
|
+
build
|
7
|
+
.svelte-kit
|
8
|
+
package
|
9
|
+
.env
|
10
|
+
.env.*
|
11
|
+
.conda
|
12
|
+
!.env.example
|
13
|
+
yarn.lock
|
14
|
+
poetry.lock
|
15
|
+
.vercel
|
16
|
+
data
|
17
|
+
metadata
|
18
|
+
eurosat-stac
|
19
|
+
.ipynb_checkpoints
|
20
|
+
eurosat-stac**
|
21
|
+
.coverage
|
22
|
+
data
|
23
|
+
db
|
24
|
+
*.zip
|
25
|
+
docker-compose.prod.yml
|
26
|
+
tutorials/*md
|
27
|
+
!test.zip
|
28
|
+
.vscode
|
29
|
+
kk
|
30
|
+
auth.json
|
31
|
+
node_modules/
|
32
|
+
/test-results/
|
33
|
+
playwright-report
|
34
|
+
playwright/.cache/
|
35
|
+
test-results
|
36
|
+
lightning_logs
|
37
|
+
jobs.csv
|
38
|
+
*.parquet
|
39
|
+
download_commands.txt
|
40
|
+
_data
|
41
|
+
datasets.csv
|
42
|
+
files_map.csv
|
43
|
+
models.csv
|
@@ -1,36 +1,18 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: eotdl
|
3
|
-
Version: 2025.
|
3
|
+
Version: 2025.4.2.post2
|
4
4
|
Summary: Earth Observation Training Data Lab
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Requires-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
17
|
-
Requires-Dist: black (>=23.10.1,<24.0.0)
|
18
|
-
Requires-Dist: geomet (>=1.0.0,<2.0.0)
|
19
|
-
Requires-Dist: geopandas (>=0.13.2,<0.14.0)
|
20
|
-
Requires-Dist: markdown (>=3.5.2,<4.0.0)
|
21
|
-
Requires-Dist: markdownify (>=0.11.6,<0.12.0)
|
22
|
-
Requires-Dist: mypy (>=1.6.1,<2.0.0)
|
23
|
-
Requires-Dist: openeo (>=0.31.0,<0.32.0)
|
24
|
-
Requires-Dist: pydantic (>=1.10.6,<2.0.0)
|
25
|
-
Requires-Dist: pyjwt (>=2.6.0,<3.0.0)
|
26
|
-
Requires-Dist: pystac[validation] (==1.8.2)
|
27
|
-
Requires-Dist: python-frontmatter (>=1.1.0,<2.0.0)
|
28
|
-
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
29
|
-
Requires-Dist: rasterio (>=1.3.9,<2.0.0)
|
30
|
-
Requires-Dist: requests (>=2.28.2,<3.0.0)
|
31
|
-
Requires-Dist: sentinelhub (>=3.9.1,<4.0.0)
|
32
|
-
Requires-Dist: tqdm (>=4.65.0,<5.0.0)
|
33
|
-
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
|
5
|
+
Author-email: earthpulse <it@earthpulse.es>
|
6
|
+
License-Expression: MIT
|
7
|
+
Requires-Python: >=3.12
|
8
|
+
Requires-Dist: geopandas>=1.0.1
|
9
|
+
Requires-Dist: pydantic>=2.11.1
|
10
|
+
Requires-Dist: pyjwt>=2.10.1
|
11
|
+
Requires-Dist: pystac>=1.12.2
|
12
|
+
Requires-Dist: python-frontmatter>=1.1.0
|
13
|
+
Requires-Dist: stac-geoparquet>=0.6.0
|
14
|
+
Requires-Dist: tqdm>=4.67.1
|
15
|
+
Requires-Dist: typer>=0.15.2
|
34
16
|
Description-Content-Type: text/markdown
|
35
17
|
|
36
18
|
<p align="center">
|
@@ -63,4 +45,4 @@ One of the most limiting factors of AI for EO applications is the scarcity of su
|
|
63
45
|
|
64
46
|
Generating TDS is time consuming and expensive. Data access is usually limited and costly, especially for Very High Resolution (VHR) images that allow objects like trees to be clearly identified. In some cases, domain experts or even in-person (in-situ) trips are required to manually confirm the objects in a satellite image are correctly annotated with a high degree of quality. This results in the field of AI for EO applications lagging when compared to other fields, impeding the development of new applications and limiting the full potential of AI in EO.
|
65
47
|
|
66
|
-
The European Space Agency (ESA) Earth Observation Training Data Lab (EOTDL) will address key limitations and capability gaps for working with Machine Learning (ML) training data in EO by providing a set of open-source tools to create, share, and improve datasets as well as training ML algorithms in the cloud. EOTDL will also offer an online repository where datasets and models can be explored and accessed.
|
48
|
+
The European Space Agency (ESA) Earth Observation Training Data Lab (EOTDL) will address key limitations and capability gaps for working with Machine Learning (ML) training data in EO by providing a set of open-source tools to create, share, and improve datasets as well as training ML algorithms in the cloud. EOTDL will also offer an online repository where datasets and models can be explored and accessed.
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "2025.04.02-2"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"""
|
2
|
+
Data access module for eotdl package.
|
3
|
+
"""
|
4
|
+
|
5
|
+
from .download import (
|
6
|
+
download_sentinel_imagery,
|
7
|
+
search_and_download_sentinel_imagery,
|
8
|
+
advanced_imagery_download,
|
9
|
+
)
|
10
|
+
from .search import search_sentinel_imagery, advanced_imagery_search
|
11
|
+
from .sentinelhub.parameters import (
|
12
|
+
SUPPORTED_COLLECTION_IDS,
|
13
|
+
DATA_COLLECTION_ID,
|
14
|
+
get_default_parameters,
|
15
|
+
OUTPUT_FORMAT,
|
16
|
+
)
|
17
|
+
from .sentinelhub.evalscripts import EvalScripts
|
@@ -0,0 +1,97 @@
|
|
1
|
+
"""
|
2
|
+
Download imagery
|
3
|
+
"""
|
4
|
+
|
5
|
+
from datetime import datetime, timedelta
|
6
|
+
from typing import Union, List, Optional
|
7
|
+
|
8
|
+
from .sentinelhub import (
|
9
|
+
SHClient,
|
10
|
+
evaluate_sentinel_parameters,
|
11
|
+
imagery_from_tmp_to_dir,
|
12
|
+
get_default_parameters,
|
13
|
+
SHParameters,
|
14
|
+
filter_times,
|
15
|
+
)
|
16
|
+
from .search import advanced_imagery_search
|
17
|
+
|
18
|
+
|
19
|
+
def download_sentinel_imagery(
|
20
|
+
output: str,
|
21
|
+
time_interval: Union[str, datetime, List[Union[str, datetime]]],
|
22
|
+
bounding_box: List[Union[int, float]],
|
23
|
+
collection_id: str,
|
24
|
+
name: Optional[str] = None,
|
25
|
+
) -> None:
|
26
|
+
"""
|
27
|
+
Download Sentinel imagery
|
28
|
+
"""
|
29
|
+
evaluate_sentinel_parameters(time_interval, bounding_box, collection_id, output)
|
30
|
+
parameters = get_default_parameters(collection_id)
|
31
|
+
return advanced_imagery_download(
|
32
|
+
output, time_interval, bounding_box, parameters, name
|
33
|
+
)
|
34
|
+
|
35
|
+
|
36
|
+
def advanced_imagery_download(
|
37
|
+
output: str,
|
38
|
+
time_interval: Union[str, datetime, List[Union[str, datetime]]],
|
39
|
+
bounding_box: List[Union[int, float]],
|
40
|
+
parameters: SHParameters,
|
41
|
+
name: Optional[str] = None,
|
42
|
+
) -> None:
|
43
|
+
"""
|
44
|
+
Advanced imagery download
|
45
|
+
"""
|
46
|
+
evaluate_sentinel_parameters(
|
47
|
+
time_interval, bounding_box, output=output, parameters=parameters
|
48
|
+
)
|
49
|
+
client = SHClient(parameters.BASE_URL)
|
50
|
+
|
51
|
+
results = advanced_imagery_search(time_interval, bounding_box, parameters)
|
52
|
+
timestamps = results.get_timestamps()
|
53
|
+
time_difference = timedelta(hours=1)
|
54
|
+
filtered_timestamps = filter_times(timestamps, time_difference)
|
55
|
+
|
56
|
+
requests_list = []
|
57
|
+
for date in filtered_timestamps:
|
58
|
+
timestamp_interval = (date - time_difference, date + time_difference)
|
59
|
+
requests_list.append(
|
60
|
+
client.request_data(timestamp_interval, bounding_box, parameters)
|
61
|
+
)
|
62
|
+
if len(requests_list) == 0:
|
63
|
+
print(
|
64
|
+
f"No images found for {parameters.DATA_COLLECTION.api_id} in the specified time: {time_interval}"
|
65
|
+
)
|
66
|
+
return
|
67
|
+
elif len(requests_list) <= 2:
|
68
|
+
bulk = False
|
69
|
+
else:
|
70
|
+
bulk = True
|
71
|
+
|
72
|
+
client.download_data(requests_list)
|
73
|
+
imagery_from_tmp_to_dir(
|
74
|
+
output,
|
75
|
+
bounding_box,
|
76
|
+
client.tmp_dir,
|
77
|
+
name=name,
|
78
|
+
bulk=bulk,
|
79
|
+
output_format=parameters.OUTPUT_FORMAT.value,
|
80
|
+
)
|
81
|
+
|
82
|
+
|
83
|
+
def search_and_download_sentinel_imagery(
|
84
|
+
output: str,
|
85
|
+
time_interval: Union[str, datetime, List[Union[str, datetime]]],
|
86
|
+
bounding_box: List[Union[int, float]],
|
87
|
+
sensor: str,
|
88
|
+
) -> None:
|
89
|
+
"""
|
90
|
+
Search and download Sentinel imagery
|
91
|
+
"""
|
92
|
+
from warnings import warn
|
93
|
+
|
94
|
+
warn(
|
95
|
+
"The function `search_and_download_sentinel_imagery` has been deprecated and will be removed in future updates. Please use download_satellite_imagery instead."
|
96
|
+
)
|
97
|
+
download_sentinel_imagery(output, time_interval, bounding_box, sensor)
|
@@ -0,0 +1,52 @@
|
|
1
|
+
"""
|
2
|
+
Search imagery
|
3
|
+
"""
|
4
|
+
|
5
|
+
from typing import Union, List
|
6
|
+
from datetime import datetime
|
7
|
+
|
8
|
+
from .sentinelhub import (
|
9
|
+
SHClient,
|
10
|
+
get_default_parameters,
|
11
|
+
evaluate_sentinel_parameters,
|
12
|
+
SHParameters,
|
13
|
+
supports_cloud_coverage,
|
14
|
+
)
|
15
|
+
|
16
|
+
|
17
|
+
def search_sentinel_imagery(
|
18
|
+
time_interval: Union[str, datetime, List[Union[str, datetime]]],
|
19
|
+
bounding_box: List[Union[int, float]],
|
20
|
+
collection_id: str,
|
21
|
+
) -> None:
|
22
|
+
"""
|
23
|
+
Search Sentinel imagery
|
24
|
+
"""
|
25
|
+
evaluate_sentinel_parameters(
|
26
|
+
time_interval, bounding_box, collection_id, output_needed=False
|
27
|
+
)
|
28
|
+
parameters = get_default_parameters(collection_id)
|
29
|
+
client = SHClient(parameters.BASE_URL)
|
30
|
+
return client.search_data(bounding_box, time_interval, parameters)
|
31
|
+
|
32
|
+
|
33
|
+
def advanced_imagery_search(
|
34
|
+
time_interval: Union[str, datetime, List[Union[str, datetime]]],
|
35
|
+
bounding_box: List[Union[int, float]],
|
36
|
+
parameters: SHParameters,
|
37
|
+
) -> None:
|
38
|
+
"""
|
39
|
+
Advanced imagery search
|
40
|
+
"""
|
41
|
+
evaluate_sentinel_parameters(
|
42
|
+
time_interval, bounding_box, output_needed=False, parameters=parameters
|
43
|
+
)
|
44
|
+
|
45
|
+
if (
|
46
|
+
supports_cloud_coverage(parameters.DATA_COLLECTION.api_id)
|
47
|
+
and parameters.MAX_CLOUD_COVERAGE
|
48
|
+
):
|
49
|
+
parameters.FILTER = "eo:cloud_cover < " + str(parameters.MAX_CLOUD_COVERAGE)
|
50
|
+
|
51
|
+
client = SHClient(parameters.BASE_URL)
|
52
|
+
return client.search_data(bounding_box, time_interval, parameters)
|
@@ -3,6 +3,10 @@ Sentinel-Hub data access module.
|
|
3
3
|
"""
|
4
4
|
|
5
5
|
from .client import SHClient
|
6
|
-
from .parameters import
|
6
|
+
from .parameters import (
|
7
|
+
SHParameters,
|
8
|
+
supports_cloud_coverage,
|
9
|
+
get_default_parameters,
|
10
|
+
)
|
7
11
|
from .evalscripts import EvalScripts
|
8
|
-
from .utils import evaluate_sentinel_parameters, imagery_from_tmp_to_dir
|
12
|
+
from .utils import evaluate_sentinel_parameters, imagery_from_tmp_to_dir, filter_times
|
@@ -3,6 +3,7 @@ Module for managing the Sentinel Hub configuration and data access
|
|
3
3
|
"""
|
4
4
|
|
5
5
|
import json
|
6
|
+
from datetime import datetime
|
6
7
|
from os import getenv
|
7
8
|
from os.path import exists
|
8
9
|
from sentinelhub import (
|
@@ -13,12 +14,11 @@ from sentinelhub import (
|
|
13
14
|
CRS,
|
14
15
|
SentinelHubRequest,
|
15
16
|
SentinelHubDownloadClient,
|
16
|
-
MimeType,
|
17
17
|
)
|
18
|
+
import uuid
|
18
19
|
|
19
20
|
from ...repos.AuthRepo import AuthRepo
|
20
21
|
from .parameters import SHParameters
|
21
|
-
from ...tools.time_utils import prepare_time_interval
|
22
22
|
from ...tools.geo_utils import compute_image_size
|
23
23
|
|
24
24
|
|
@@ -27,7 +27,7 @@ class SHClient:
|
|
27
27
|
Client class to manage the Sentinel Hub Python interface.
|
28
28
|
"""
|
29
29
|
|
30
|
-
def __init__(self) -> None:
|
30
|
+
def __init__(self, base_url) -> None:
|
31
31
|
""" """
|
32
32
|
self.config = SHConfig()
|
33
33
|
if getenv("SH_CLIENT_ID") and getenv("SH_CLIENT_SECRET"):
|
@@ -56,8 +56,9 @@ class SHClient:
|
|
56
56
|
else:
|
57
57
|
self.config.sh_client_id = creds["SH_CLIENT_ID"]
|
58
58
|
self.config.sh_client_secret = creds["SH_CLIENT_SECRET"]
|
59
|
+
self.config.sh_base_url = base_url
|
59
60
|
self.catalog = SentinelHubCatalog(config=self.config)
|
60
|
-
self.tmp_dir = "/tmp/sentinelhub"
|
61
|
+
self.tmp_dir = "/tmp/sentinelhub/" + str(uuid.uuid4())
|
61
62
|
|
62
63
|
def search_data(
|
63
64
|
self, bounding_box: list, time_interval: list, parameters: SHParameters
|
@@ -76,12 +77,11 @@ class SHClient:
|
|
76
77
|
return search_iterator
|
77
78
|
|
78
79
|
def request_data(
|
79
|
-
self, time_interval, bounding_box: list, parameters: SHParameters
|
80
|
+
self, time_interval: datetime, bounding_box: list, parameters: SHParameters
|
80
81
|
) -> list:
|
81
82
|
"""
|
82
83
|
Request data from Sentinel Hub
|
83
84
|
"""
|
84
|
-
time_interval = prepare_time_interval(time_interval)
|
85
85
|
bounding_box, _ = compute_image_size(bounding_box, parameters)
|
86
86
|
|
87
87
|
return SentinelHubRequest(
|
@@ -94,7 +94,9 @@ class SHClient:
|
|
94
94
|
mosaicking_order=parameters.MOSAICKING_ORDER,
|
95
95
|
)
|
96
96
|
],
|
97
|
-
responses=[
|
97
|
+
responses=[
|
98
|
+
SentinelHubRequest.output_response("default", parameters.OUTPUT_FORMAT)
|
99
|
+
],
|
98
100
|
bbox=bounding_box,
|
99
101
|
size=bbox_to_dimensions(bounding_box, parameters.RESOLUTION),
|
100
102
|
config=self.config,
|
@@ -109,5 +111,4 @@ class SHClient:
|
|
109
111
|
requests = [requests]
|
110
112
|
download_requests = [request.download_list[0] for request in requests]
|
111
113
|
data = download_client.download(download_requests)
|
112
|
-
|
113
114
|
return data
|