Skip to content

Commit ec200f5

Browse files
jlahovniksbrunato
andauthored
refactor: adaptations to align with v4 of eodag (#68)
adaptations to align with eodag v4 (currently pre-release), mainly the change of property names to conform to STAC Fixes #69 --------- Co-authored-by: Sylvain Brunato <sylvain.brunato@c-s.fr>
1 parent 7f6c14a commit ec200f5

23 files changed

Lines changed: 475 additions & 473 deletions

helm/stac-fastapi-eodag/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The command removes all the Kubernetes components associated with the chart and
7575

7676
| Name | Description | Value |
7777
| --------------------------- | ----------------------------------------------------------------------------------- | ----- |
78-
| `productTypes` | Optional overwrite of product types default configuration | `""` |
78+
| `collections` | Optional overwrite of collections default configuration | `""` |
7979
| `providers` | Optional overwrite of providers default configuration | `""` |
8080
| `config` | EODAG configuration | `{}` |
8181
| `configExistingSecret.name` | Existing secret name for EODAG config. If this is set, value config will be ignored | `""` |

helm/stac-fastapi-eodag/templates/configmap.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright CS GROUP - France, https://www.cs-soprasteria.com
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- if or .Values.productTypes .Values.providers }}
6+
{{- if or .Values.collections .Values.providers }}
77
apiVersion: v1
88
kind: ConfigMap
99
metadata:
@@ -17,9 +17,9 @@ metadata:
1717
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
1818
{{- end }}
1919
data:
20-
{{- if .Values.productTypes }}
21-
product_types.yml: |-
22-
{{- .Values.productTypes | nindent 4 }}
20+
{{- if .Values.collections }}
21+
collections.yml: |-
22+
{{- .Values.collections | nindent 4 }}
2323
{{- end }}
2424
{{- if .Values.providers }}
2525
providers.yml: |-

helm/stac-fastapi-eodag/templates/deployment.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
3636
{{- end }}
3737
annotations:
38-
{{- if or .Values.productTypes .Values.providers }}
38+
{{- if or .Values.collections .Values.providers }}
3939
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
4040
{{- end }}
4141
{{- if and .Values.otel.collector.enabled .Values.otel.collector.config }}
@@ -157,9 +157,9 @@ spec:
157157
- name: EODAG_CFG_FILE
158158
value: /eodag/resources/eodag.yml
159159
{{- end }}
160-
{{- if .Values.productTypes }}
161-
- name: EODAG_PRODUCT_TYPES_CFG_FILE
162-
value: /eodag/resources/product_types.yml
160+
{{- if .Values.collections }}
161+
- name: EODAG_collectionS_CFG_FILE
162+
value: /eodag/resources/collections.yml
163163
{{- end }}
164164
{{- if .Values.providers }}
165165
- name: EODAG_PROVIDERS_CFG_FILE
@@ -226,10 +226,10 @@ spec:
226226
resources: {{- toYaml .Values.resources | nindent 12 }}
227227
{{- end }}
228228
volumeMounts:
229-
{{- if .Values.productTypes }}
229+
{{- if .Values.collections }}
230230
- name: config
231-
mountPath: /eodag/resources/product_types.yml
232-
subPath: product_types.yml
231+
mountPath: /eodag/resources/collections.yml
232+
subPath: collections.yml
233233
{{- end }}
234234
{{- if .Values.providers }}
235235
- name: config
@@ -266,7 +266,7 @@ spec:
266266
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
267267
{{- end }}
268268
volumes:
269-
{{- if or .Values.productTypes .Values.providers }}
269+
{{- if or .Values.collections .Values.providers }}
270270
- name: config
271271
configMap:
272272
name: {{ printf "%s-config" (include "common.names.fullname" .) }}

helm/stac-fastapi-eodag/values.yaml

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ extraDeploy: []
5353
## ref: https://eodag.readthedocs.io/en/stable/
5454
##
5555

56-
## @param productTypes Optional overwrite of product types default configuration
57-
## ref: https://github.com/CS-SI/eodag/blob/masster/eodag/resources/product_types.yml
58-
productTypes: ""
59-
# productTypes: |-
56+
## @param collections Optional overwrite of product types default configuration
57+
## ref: https://github.com/CS-SI/eodag/blob/master/eodag/resources/collections.yml
58+
collections: ""
59+
# collections: |-
6060
# # CBERS 4 ---------------------------------------------------------------------
6161
# CBERS4_MUX_L2:
62-
# abstract: |
62+
# description: |
6363
# China-Brazil Earth Resources Satellite, CBERS-4 MUX camera Level-2 product. System corrected images, expect some
6464
# translation error.
65-
# instrument: MUX
66-
# platform: CBERS
67-
# platformSerialIdentifier: CBERS-4
68-
# processingLevel: L2
69-
# keywords: MUX,CBERS,CBERS-4,L2
70-
# sensorType: OPTICAL
71-
# license: proprietary
72-
# missionStartDate: "2014-12-07T00:00:00Z"
65+
# instruments: ["MUX"]
66+
# constellation: CBERS
67+
# platform: CBERS-4
68+
# processing:level: L2
69+
# keywords: ["MUX", "CBERS", "CBERS-4", "L2"]
70+
# eodag:sensor_type: OPTICAL
71+
# license: other
72+
# extent: {"temporal": {"interval": [["2014-12-07T00:00:00Z", null]]}}
7373
# title: CBERS-4 MUX Level-2
7474

7575
## @param providers Optional overwrite of providers default configuration
@@ -86,45 +86,52 @@ providers: ""
8686
# api: !plugin
8787
# type: UsgsApi
8888
# need_auth: true
89-
# google_base_url: 'http://storage.googleapis.com/earthengine-public/landsat/'
9089
# pagination:
9190
# max_items_per_page: 5000
9291
# total_items_nb_key_path: '$.totalHits'
93-
# common_metadata_mapping_path: '$'
9492
# metadata_mapping:
95-
# id: '$.displayId'
93+
# id:
94+
# - '_ID'
95+
# - '$.displayId'
9696
# geometry: '$.spatialBounds'
97-
# productType: '$.productType'
9897
# title: '$.displayId'
99-
# abstract: '$.summary'
100-
# cloudCover: '$.cloudCover'
101-
# startTimeFromAscendingNode: '$.temporalCoverage.startDate'
102-
# completionTimeFromAscendingNode: '$.temporalCoverage.endDate'
103-
# publicationDate: '$.publishDate'
104-
# thumbnail: '$.browse[0].thumbnailPath'
105-
# quicklook: '$.browse[0].browsePath'
106-
# storageStatus: '{$.available#get_group_name((?P<ONLINE>True)|(?P<OFFLINE>False))}'
107-
# downloadLink: 'https://earthexplorer.usgs.gov/download/external/options/{productType}/{entityId}/M2M/'
98+
# description: '$.summary'
99+
# eo:cloud_cover: '$.cloudCover'
100+
# start_datetime: '$.temporalCoverage.startDate'
101+
# end_datetime: '$.temporalCoverage.endDate'
102+
# published: '$.publishDate'
103+
# eodag:thumbnail: '$.browse[0].thumbnailPath'
104+
# eodag:quicklook: '$.browse[0].browsePath'
105+
# order:status: '{$.available#get_group_name((?P<succeeded>True)|(?P<orderable>False))}'
106+
# eodag:download_link: 'https://earthexplorer.usgs.gov/download/external/options/{_collection}/{entityId}/M2M/'
108107
# # metadata needed for download
109-
# entityId: '$.entityId'
110-
# productId: '$.id'
108+
# usgs:entityId: '$.entityId'
109+
# usgs:productId: '$.id'
111110
# extract: True
112111
# order_enabled: true
113112
# products:
114113
# # datasets list http://kapadia.github.io/usgs/_sources/reference/catalog/ee.txt may be outdated
115114
# # see also https://dds.cr.usgs.gov/ee-data/coveragemaps/shp/ee/
116115
# LANDSAT_C2L1:
117-
# dataset: landsat_ot_c2_l1
118-
# outputs_extension: .tar.gz
116+
# _collection: landsat_ot_c2_l1
119117
# LANDSAT_C2L2:
120-
# dataset: landsat_ot_c2_l2
121-
# outputs_extension: .tar.gz
118+
# _collection: landsat_ot_c2_l2
119+
# LANDSAT_TM_C1:
120+
# _collection: landsat_tm_c1
121+
# LANDSAT_TM_C2L1:
122+
# _collection: landsat_tm_c2_l1
123+
# LANDSAT_TM_C2L2:
124+
# _collection: landsat_tm_c2_l2
125+
# LANDSAT_ETM_C1:
126+
# _collection: landsat_etm_c1
127+
# LANDSAT_ETM_C2L1:
128+
# _collection: landsat_etm_c2_l1
129+
# LANDSAT_ETM_C2L2:
130+
# _collection: landsat_etm_c2_l2
122131
# S2_MSI_L1C:
123-
# dataset: SENTINEL_2A
124-
# outputs_extension: .zip
125-
# GENERIC_PRODUCT_TYPE:
126-
# dataset: '{productType}'
127-
132+
# _collection: SENTINEL_2A
133+
# GENERIC_COLLECTION:
134+
# _collection: '{collection}'
128135

129136
## @param config [object] EODAG configuration
130137
## doc: https://eodag.readthedocs.io/en/stable/getting_started_guide/configure.html

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ license = { file = "LICENSE" }
88
requires-python = ">= 3.9"
99
dependencies = [
1010
"attr",
11-
"eodag[all-providers] < 4.0.0",
11+
"eodag[all-providers] == 4.0.0a1",
1212
"fastapi",
13+
"geojson",
1314
"geojson-pydantic",
1415
"orjson",
1516
"pydantic",
@@ -41,7 +42,6 @@ telemetry = [
4142
]
4243
dev = [
4344
"stac_fastapi.eodag[server,telemetry]",
44-
"geojson",
4545
"httpx",
4646
"importlib-metadata",
4747
"mypy",

stac_fastapi/eodag/constants.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,6 @@
1717
# limitations under the License.
1818
"""Constants"""
1919

20-
ITEM_PROPERTIES_EXCLUDE = {
21-
"_id": True,
22-
"productType": True,
23-
"downloadLink": True,
24-
"orderLink": True,
25-
"orderStatus": True,
26-
"orderStatusLink": True,
27-
"searchLink": True,
28-
"missionStartDate": True,
29-
"missionEndDate": True,
30-
"keywords": True,
31-
"_date": True,
32-
"_dc_qs": True,
33-
"qs": True,
34-
"defaultGeometry": True,
35-
}
36-
3720
CACHE_KEY_COLLECTIONS = "collections"
3821
CACHE_KEY_COLLECTION = "collection"
3922
CACHE_KEY_SEARCH = "search"

0 commit comments

Comments
 (0)