Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test generation of yAxis #62

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading