From d51bf63cf5705f72eba3fc2c7543e5c7d45e2eb6 Mon Sep 17 00:00:00 2001 From: Sylvain Brunato Date: Thu, 24 Feb 2022 15:01:06 +0100 Subject: [PATCH] fix: remove earth_search_cog and add S2_MSI_L2A_COG to earth_search --- eodag/resources/providers.yml | 44 +++++++------------------- eodag/resources/user_conf_template.yml | 5 --- tests/test_end_to_end.py | 2 +- 3 files changed, 12 insertions(+), 39 deletions(-) diff --git a/eodag/resources/providers.yml b/eodag/resources/providers.yml index f55a50035..8387a6b49 100644 --- a/eodag/resources/providers.yml +++ b/eodag/resources/providers.yml @@ -1705,6 +1705,9 @@ # say the max is 10_000. In practice a too high number (e.g. 5_000) returns a 502 error ({"message": "Internal server error"}). # Let's set it to a more robust number: 500 max_items_per_page: 500 + metadata_mapping: + keywords: | + {$.collection#get_group_name((?=.*(?P-cog).*)?(?=.*(?P-s2).*)?(?=.*(?Plandsat-8).*)?(?=.*(?P-l1c).*)?(?=.*(?P-l2a).*)?)} products: S2_MSI_L1C: productType: sentinel-s2-l1c @@ -1726,6 +1729,14 @@ $.properties."sentinel:product_id".`sub(/([S2AB]{3})_MSIL2A_([0-9]{4})([0-9]{2})([0-9]{2})(T.*)/, products/\\2/\\3/\\4/\\1_MSIL2A_\\2\\3\\4\\5)`.`sub(/\/0+/, \/)` tilePath: | $.assets.info.href.`sub(/.*/sentinel-s2-l2a\/(tiles\/.*)\/tileInfo\.json/, \\1)` + S2_MSI_L2A_COG: + productType: sentinel-s2-l2a-cogs + metadata_mapping: + assets: '$.assets' + download: !plugin + type: HTTPDownload + base_uri: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com' + auth: L8_OLI_TIRS_C1L1: productType: landsat-8-l1-c1 GENERIC_PRODUCT_TYPE: @@ -1749,36 +1760,3 @@ - tilePath auth: !plugin type: AwsAuth - ---- -!provider - name: earth_search_cog - priority: 0 - roles: - - host - description: Earth Search - url: https://www.element84.com/earth-search/ - search: !plugin - type: StacSearch - api_endpoint: https://earth-search.aws.element84.com/v0/search - pagination: - # Override the default next page url key path of StacSearch because the next link returned - # by Earth Search is invalid (as of 2021/04/29). Entry set to null (None) to avoid using the - # next page retrieval mechanism, `next_page_url_tpl` will be used instead (inherited from StacSearch) - # Remove that entry if Earth Search updates that and returns a valid link. - next_page_url_key_path: null - # 2021/04/28: Earth-Search relies on Sat-API whose docs (http://sat-utils.github.io/sat-api/#search-stac-items-by-simple-filtering-) - # say the max is 10_000. In practice a too high number (e.g. 5_000) returns a 502 error ({"message": "Internal server error"}). - # Let's set it to a more robust number: 500 - max_items_per_page: 500 - metadata_mapping: - platformSerialIdentifier: '$.id.`split(_, 0, -1)`' - polarizationMode: '$.id.`sub(/.{14}([A-Z]{2}).*/, \\1)`' - products: - S2_MSI_L2A_COG: - productType: sentinel-s2-l2a-cogs - GENERIC_PRODUCT_TYPE: - productType: '{productType}' - download: !plugin - type: HTTPDownload - base_uri: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com' diff --git a/eodag/resources/user_conf_template.yml b/eodag/resources/user_conf_template.yml index f3ed7d02a..75df43bd7 100644 --- a/eodag/resources/user_conf_template.yml +++ b/eodag/resources/user_conf_template.yml @@ -128,8 +128,3 @@ earth_search: aws_profile: download: outputs_prefix: -earth_search_cog: - priority: # Lower value means lower priority (Default: 0) - search: # Search parameters configuration - download: - outputs_prefix: diff --git a/tests/test_end_to_end.py b/tests/test_end_to_end.py index 12829166b..55af44f1a 100644 --- a/tests/test_end_to_end.py +++ b/tests/test_end_to_end.py @@ -86,7 +86,7 @@ [0.2563590566012408, 43.19555008715042, 2.379835675499976, 43.907759172380565], ] EARTH_SEARCH_COG_SEARCH_ARGS = [ - "earth_search_cog", + "earth_search", "S2_MSI_L2A_COG", "2020-01-01", "2020-01-15",