Skip to content

Commit

Permalink
Merge branch 'main' into tri_assets
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Jan 2, 2024
2 parents 100db95 + 3687552 commit cfd8802
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 25 deletions.
2 changes: 1 addition & 1 deletion catalogs/race.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ collections:
- OX_Crude_Oil_Storage_Index
- OX_EU_Crude_Oil_Storage_Index
# - OW_Covid_19_vaccinations
- GG_Mobility_Data
- GG_Google_Mobility_Data_RACE
# - CV_Covid_19_cases
8 changes: 5 additions & 3 deletions catalogs/trilateral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ endpoint: "https://eurodatacube.github.io/eodash-catalog/trilateral/"
assets_endpoint: "https://raw.githubusercontent.com/eurodatacube/eodash-assets/main/collections"
collections:
- E9_car_containers
- N1_NO2
- N1_NO2_trilateral
- N1_CH4
- N1_CO
- N1_SO2
# - N2_greenhouse_gases
- no2-monthly
- no2-monthly-diff
- N1_NO2_monthly
- N1_NO2_diff_monthly
- N1_NO2_city_trilateral
- co2-mean
- facebook_population_density
- OMI_trno2-COG
Expand Down Expand Up @@ -87,3 +88,4 @@ collections:
- ESDC_gross_primary_productivity
- ESDC_kndvi
- ESDC_net_ecosystem_exchange
- GG_Google_Mobility_Data_trilateral
2 changes: 1 addition & 1 deletion collections/E12c_truck_detections_motorways_GTIF.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Resources:
Type: byoc
CollectionId: 34fbfb05-c3e5-4885-9840-830ee85dddd4
LayerId: VIS_TRUCK_DETECTION_MOTORWAYS_NEW
OverwriteBBox: [46.4, 49, 9.5, 17]
OverwriteBBox: [5.5, 44.0, 16.5, 48.7]
Image: E12c_truck_detections_motorways_GTIF/thumbnail.png
Legend: E12c_truck_detections_motorways_GTIF/cm_legend.png
2 changes: 1 addition & 1 deletion collections/E12d_truck_detections_primary_roads_GTIF.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Resources:
Type: byoc
CollectionId: 81201dac-c408-4cf8-b9a5-ca8349e4ab6c
LayerId: VIS_TRUCK_DETECTION_PRIMARY_NEW
OverwriteBBox: [46.4, 49, 9.5, 17]
OverwriteBBox: [5.5, 44.0, 16.5, 48.7]
Image: E12d_truck_detections_primary_roads_GTIF/thumbnail.png
Legend: E12d_truck_detections_motorways_GTIF/cm_legend.png
22 changes: 22 additions & 0 deletions collections/GG_Google_Mobility_Data_RACE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Name: GG_Google_Mobility_Data_RACE
Title: Mobility
EodashIdentifier: GG
Subtitle: Mobility data from Google
Description: GG_Google_Mobility_Data/GG.md
Themes:
- economy
Tags:
- placeholder
Satellite:
- placeholder
Sensor:
- placeholder
Agency:
- ESA
Resources:
- EndPoint: https://xcube-geodb.brockmann-consult.de/eodash/6bf15325-f6a0-4b6a-bf80-a2491753f8f2/
Name: GeoDB
Database: eodash
CollectionId: Mobility_data
AdditionalQueryString: 'aoi_id=in.("AT","BA","BE","BG","CH","CZ","DE","DK","EE","EG","ES","FI","FR","GB","GR","HR","HU","IE","IT","LT","LU","LV","MK","MT","NL","NO","PL","PT","RO","RS","RU","SE","SI","SK","TR")'
IdKey: 'aoi_id'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: GG_Google_Mobility_Data
Name: GG_Google_Mobility_Data_trilateral
Title: Mobility
EodashIdentifier: GG
Subtitle: Mobility data from Google
Expand All @@ -18,3 +18,4 @@ Resources:
Name: GeoDB
Database: eodash
CollectionId: Mobility_data
IdKey: 'aoi_id'
20 changes: 20 additions & 0 deletions collections/N1_NO2_city_trilateral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Name: N1_NO2_city_trilateral
Title: City level NO2 (S5P)
EodashIdentifier: N1_NO2_city_trilateral
Subtitle: NO2 detected at cities based on Sentinel-5P data
Description: N1_NO2_city_trilateral/N1.md
Themes:
- air
Tags:
- placeholder
Satellite:
- Sentinel-5P
Sensor:
- placeholder
Agency:
- ESA
Resources:
- EndPoint: https://xcube-geodb.brockmann-consult.de/eodash/6bf15325-f6a0-4b6a-bf80-a2491753f8f2/
Name: GeoDB
Database: eodash
CollectionId: N1_tri
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Name: no2-monthly-diff
Name: N1_NO2_diff_monthly
Title: Nitrogen Dioxide (Monthly difference)
EodashIdentifier: N1_NO2_monthly_diff
EodashIdentifier: N1_NO2_diff_monthly
Subtitle: Monthly difference of Nitrogen Dioxide (NO2) from NASA [10^15 molecules/cm²]
Description: OMI_trno2-COG/N9.md
Description: N1_NO2_diff_monthly/N9.md
Themes:
- atmosphere
Tags:
Expand All @@ -13,7 +13,7 @@ Sensor:
- placeholder
Agency:
- NASA
Legend: no2-monthly-diff/cm_legend.png
Legend: N1_NO2_diff_monthly/cm_legend.png
Services:
- Endpoint: https://services.sentinel-hub.com/api/v1/statistics
Name: VEDA Statistics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Name: no2-monthly
Name: N1_NO2_monthly
Title: Nitrogen Dioxide (Monthly)
EodashIdentifier: N1_NO2_monthly
Subtitle: Monthly Nitrogen Dioxide (NO2) from NASA
Description: OMI_trno2-COG/N9.md
Description: N1_NO2_monthly/N9.md
Themes:
- atmosphere
Tags:
Expand All @@ -13,7 +13,7 @@ Sensor:
- placeholder
Agency:
- NASA
Legend: no2-monthly/cm_legend.png
Legend: N1_NO2_monthly/cm_legend.png
Services:
- Endpoint: https://services.sentinel-hub.com/api/v1/statistics
Name: VEDA Statistics
Expand Down
32 changes: 32 additions & 0 deletions collections/N1_NO2_trilateral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Name: N1_NO2_trilateral
Title: Nitrogen dioxide
EodashIdentifier: N1_NO2
Subtitle: Weekly Nitrogen Dioxide
Description: N1_NO2_trilateral/N1.md
Themes:
- air
Tags:
- placeholder
Satellite:
- Sentinel-5P
Sensor:
- TROPOMI
Agency:
- NASA
Provider:
- Name: placeholder
License: MIT
Resources:
- EndPoint: https://services.sentinel-hub.com
Name: Sentinel Hub
Type: byoc
CollectionId: 972e67a7-2ca8-4bf6-964a-11fe772e3ac2
LayerId: AWS_NO2-VISUALISATION
Services:
- Endpoint: https://services.sentinel-hub.com/api/v1/statistics
Name: Statistical API
Type: byoc
CollectionId: 972e67a7-2ca8-4bf6-964a-11fe772e3ac2
Script: N1_NO2/script.js
Image: N1_NO2/N1.png
Legend: N1_NO2/cm_legend.png
23 changes: 12 additions & 11 deletions generators/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,9 @@ def add_to_catalog(collection, catalog, endpoint, data):
def handle_GeoDB_endpoint(config, endpoint, data, catalog):
collection = get_or_create_collection(catalog, endpoint["CollectionId"], data, config, endpoint)
select = "?select=aoi,aoi_id,country,city,time"
where_parameter = endpoint.get("WhereParameter")
url = endpoint["EndPoint"] + endpoint["Database"] + "_%s"%endpoint["CollectionId"] + select
if where_parameter:
url += f"&{where_parameter}"
if additional_query_parameters := endpoint.get("AdditionalQueryString"):
url += f"&{additional_query_parameters}"
response = json.loads(requests.get(url).text)

# Sort locations by key
Expand All @@ -354,15 +353,17 @@ def handle_GeoDB_endpoint(config, endpoint, data, catalog):
unique_values = list({v["aoi_id"]:v for v in values}.values())[0]
country = unique_values["country"]
city = unique_values["city"]
IdKey = endpoint.get("IdKey", "city")
IdValue = unique_values[IdKey]
if country not in countries:
countries.append(country)
# sanitize city identifier to be sure it is filename save
if city is not None:
city = "".join([c for c in city if c.isalpha() or c.isdigit() or c==' ']).rstrip()
# Additional check to see if city name is empty afterwards
if city == "" or city is None:
# use aoi_id as a fallback unique id instead of city
city = key
# sanitize unique key identifier to be sure it is saveable as a filename
if IdValue is not None:
IdValue = "".join([c for c in IdValue if c.isalpha() or c.isdigit() or c==' ']).rstrip()
# Additional check to see if unique key name is empty afterwards
if IdValue == "" or IdValue is None:
# use aoi_id as a fallback unique id instead of configured key
IdValue = key
if city not in cities:
cities.append(city)
min_date = min(times)
Expand All @@ -373,7 +374,7 @@ def handle_GeoDB_endpoint(config, endpoint, data, catalog):
buff = 0.01
bbox = [lon-buff, lat-buff,lon+buff,lat+buff]
item = Item(
id = city,
id = IdValue,
bbox=bbox,
properties={},
geometry = create_geojson_point(lon, lat),
Expand Down

0 comments on commit cfd8802

Please sign in to comment.