Skip to content

Commit

Permalink
chore: test generation of yAxis
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Oct 23, 2023
1 parent 02a4eb2 commit eb23a4e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions generators/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit eb23a4e

Please sign in to comment.