Skip to content

Commit

Permalink
adding "thumbnails" to the template
Browse files Browse the repository at this point in the history
  • Loading branch information
baloola committed Sep 22, 2023
1 parent 04369d4 commit 1ae7175
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/data-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ body:
placeholder: OGC, WMS, WMTS, WCS, WCPS, API Coverages, API Processes, etc.
validations:
required: false
- type: input
id: thumbnails
attributes:
label: Thumbnails
description: Access thumbnails media of the dataset.
placeholder: OGC, WMS, WMTS, etc.
validations:
required: false
- type: input
id: access-control
attributes:
Expand Down
7 changes: 5 additions & 2 deletions stac/stac-generator/stac-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def create_assets(doc):
if match is not None and match.span() == (0, len(api)):
asset = pystac.Asset(
roles=["data"],
href= match.group(0)
href=match.group(0)

)
assets[f"data_{index + 1}"] = asset
Expand Down Expand Up @@ -125,7 +125,10 @@ def create_stac_item(doc, title):
properties["Data Source"] = doc["Data Source"]

if "Thumbnails" in doc.keys():
for index, thumbnail in enumerate(doc["Thumbnails"]):
thumbnails = doc["Thumbnails"]
if type(doc["Thumbnails"]) != list:
thumbnails = [doc["Thumbnails"]]
for index, thumbnail in enumerate(thumbnails):
asset = pystac.Asset(
roles=["thumbnail"],
href=thumbnail,
Expand Down

0 comments on commit 1ae7175

Please sign in to comment.