Skip to content

Commit

Permalink
fix: remove earth_search_cog and add S2_MSI_L2A_COG to earth_search
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed Feb 28, 2022
1 parent 0577ec2 commit d51bf63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
44 changes: 11 additions & 33 deletions eodag/resources/providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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>-cog).*)?(?=.*(?P<S2>-s2).*)?(?=.*(?P<L8>landsat-8).*)?(?=.*(?P<L1C>-l1c).*)?(?=.*(?P<L2A>-l2a).*)?)}
products:
S2_MSI_L1C:
productType: sentinel-s2-l1c
Expand All @@ -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:
Expand All @@ -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'
5 changes: 0 additions & 5 deletions eodag/resources/user_conf_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
2 changes: 1 addition & 1 deletion tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d51bf63

Please sign in to comment.