diff --git a/generators/generate_indicators.py b/generators/generate_indicators.py index 08cfadec..54339436 100644 --- a/generators/generate_indicators.py +++ b/generators/generate_indicators.py @@ -363,7 +363,13 @@ def handle_GeoDB_endpoint(config, endpoint, data, catalog): link.extra_fields["latlng"] = latlon link.extra_fields["country"] = country link.extra_fields["city"] = city - + + # fetch yAxis and store it to data, preventing need to save it per dataset in yml + select = "?select=y_axis&limit=1" + url = endpoint["EndPoint"] + endpoint["Database"] + "_%s"%endpoint["CollectionId"] + select + response = json.loads(requests.get(url).text) + yAxis = response[0]['y_axis'] + data['yAxis'] = yAxis add_collection_information(config, collection, data) collection.update_extent_from_items() @@ -677,8 +683,9 @@ def add_collection_information(config, collection, data): roles=["thumbnail"], ), ) - # Add extra fields to collection if available + if "yAxis" in data: + collection.extra_fields["yAxis"] = data["yAxis"] if "Themes" in data: collection.extra_fields["themes"] = data["Themes"] if "Tags" in data: