eodag 4.0.0a1__py3-none-any.whl → 4.0.0a2__py3-none-any.whl
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.
- eodag/__init__.py +6 -1
- eodag/api/collection.py +353 -0
- eodag/api/core.py +308 -296
- eodag/api/product/_product.py +15 -29
- eodag/api/product/drivers/__init__.py +2 -42
- eodag/api/product/drivers/base.py +0 -11
- eodag/api/product/metadata_mapping.py +34 -5
- eodag/api/search_result.py +144 -9
- eodag/cli.py +18 -15
- eodag/config.py +37 -3
- eodag/plugins/apis/ecmwf.py +16 -4
- eodag/plugins/apis/usgs.py +18 -7
- eodag/plugins/crunch/filter_latest_intersect.py +1 -0
- eodag/plugins/crunch/filter_overlap.py +3 -7
- eodag/plugins/search/__init__.py +3 -0
- eodag/plugins/search/base.py +6 -6
- eodag/plugins/search/build_search_result.py +157 -56
- eodag/plugins/search/cop_marine.py +48 -8
- eodag/plugins/search/csw.py +18 -8
- eodag/plugins/search/qssearch.py +331 -88
- eodag/plugins/search/static_stac_search.py +11 -12
- eodag/resources/collections.yml +610 -348
- eodag/resources/ext_collections.json +1 -1
- eodag/resources/ext_product_types.json +1 -1
- eodag/resources/providers.yml +330 -58
- eodag/resources/stac_provider.yml +4 -2
- eodag/resources/user_conf_template.yml +9 -0
- eodag/types/__init__.py +2 -0
- eodag/types/queryables.py +16 -0
- eodag/utils/__init__.py +47 -2
- eodag/utils/repr.py +2 -0
- {eodag-4.0.0a1.dist-info → eodag-4.0.0a2.dist-info}/METADATA +4 -2
- {eodag-4.0.0a1.dist-info → eodag-4.0.0a2.dist-info}/RECORD +37 -36
- {eodag-4.0.0a1.dist-info → eodag-4.0.0a2.dist-info}/WHEEL +0 -0
- {eodag-4.0.0a1.dist-info → eodag-4.0.0a2.dist-info}/entry_points.txt +0 -0
- {eodag-4.0.0a1.dist-info → eodag-4.0.0a2.dist-info}/licenses/LICENSE +0 -0
- {eodag-4.0.0a1.dist-info → eodag-4.0.0a2.dist-info}/top_level.txt +0 -0
|
@@ -36,7 +36,6 @@ from eodag.utils import HTTP_REQ_TIMEOUT, MockResponse
|
|
|
36
36
|
from eodag.utils.stac_reader import fetch_stac_collections, fetch_stac_items
|
|
37
37
|
|
|
38
38
|
if TYPE_CHECKING:
|
|
39
|
-
from eodag.api.product import EOProduct
|
|
40
39
|
from eodag.config import PluginConfig
|
|
41
40
|
|
|
42
41
|
|
|
@@ -102,6 +101,8 @@ class StaticStacSearch(StacSearch):
|
|
|
102
101
|
return None
|
|
103
102
|
fetch_url = unformatted_fetch_url.format(**self.config.__dict__)
|
|
104
103
|
|
|
104
|
+
logger.info(f"Fetching collections: {fetch_url}")
|
|
105
|
+
|
|
105
106
|
collections = fetch_stac_collections(
|
|
106
107
|
fetch_url,
|
|
107
108
|
collection=kwargs.get("q"),
|
|
@@ -157,7 +158,7 @@ class StaticStacSearch(StacSearch):
|
|
|
157
158
|
self,
|
|
158
159
|
prep: PreparedSearch = PreparedSearch(),
|
|
159
160
|
**kwargs: Any,
|
|
160
|
-
) ->
|
|
161
|
+
) -> SearchResult:
|
|
161
162
|
"""Perform a search on a static STAC Catalog"""
|
|
162
163
|
|
|
163
164
|
# only return 1 page if pagination is disabled
|
|
@@ -167,7 +168,10 @@ class StaticStacSearch(StacSearch):
|
|
|
167
168
|
and prep.items_per_page is not None
|
|
168
169
|
and prep.items_per_page <= 0
|
|
169
170
|
):
|
|
170
|
-
|
|
171
|
+
result = SearchResult([])
|
|
172
|
+
if prep.count:
|
|
173
|
+
result.number_matched = 0
|
|
174
|
+
return result
|
|
171
175
|
|
|
172
176
|
collection = kwargs.get("collection", prep.collection)
|
|
173
177
|
# provider collection specific conf
|
|
@@ -201,11 +205,9 @@ class StaticStacSearch(StacSearch):
|
|
|
201
205
|
autospec=True,
|
|
202
206
|
return_value=MockResponse(feature_collection, 200),
|
|
203
207
|
):
|
|
204
|
-
|
|
208
|
+
search_result = super(StaticStacSearch, self).query(
|
|
205
209
|
PreparedSearch(items_per_page=nb_features, page=1, count=True), **kwargs
|
|
206
210
|
)
|
|
207
|
-
# filter using query params
|
|
208
|
-
search_result = SearchResult(eo_products)
|
|
209
211
|
# Filter by date
|
|
210
212
|
if "start_datetime" in kwargs:
|
|
211
213
|
kwargs["start"] = kwargs.pop("start_datetime")
|
|
@@ -244,9 +246,6 @@ class StaticStacSearch(StacSearch):
|
|
|
244
246
|
search_result = search_result.crunch(
|
|
245
247
|
FilterProperty({property_key: property_value, "operator": "eq"})
|
|
246
248
|
)
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if prep.count
|
|
251
|
-
else (search_result.data, None)
|
|
252
|
-
)
|
|
249
|
+
if prep.count:
|
|
250
|
+
search_result.number_matched = len(search_result.data)
|
|
251
|
+
return search_result
|