Skip to content

Commit

Permalink
fix: removed static overwrite of veda tiles config, fixed wrong call …
Browse files Browse the repository at this point in the history
…to renamed method
  • Loading branch information
santilland committed Feb 15, 2024
1 parent 4eb2f28 commit 734c6e6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions generators/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ def generate_veda_cog_link(endpoint, file_url):
return target_url

def generate_veda_tiles_link(endpoint, item):
collection = "collection=%s"%endpoint["CollectionId"]
assets = ""
for asset in endpoint["Assets"]:
assets += "&assets=%s"%asset
Expand All @@ -695,10 +696,11 @@ def generate_veda_tiles_link(endpoint, item):
if "NoData" in endpoint:
no_data = "&no_data=%s"%endpoint["NoData"]
if item:
item = "item=%s&"%(item)
item = "&item=%s"%(item)
else:
item = ""
target_url = "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}?%s%s%s%s"%(
target_url = "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}?%s%s%s%s%s"%(
collection,
item,
assets,
color_formula,
Expand Down Expand Up @@ -818,11 +820,7 @@ def add_visualization_info(stac_object, data, endpoint, file_url=None, time=None
if endpoint["Type"] == "cog":
target_url = generate_veda_cog_link(endpoint, file_url)
elif endpoint["Type"] == "tiles":
item_kvp = ""
if file_url:
item_kvp = "&item=%s"%file_url
target_url = generate_veda_tiles_link(endpoint, file_url)
target_url = "https://staging-raster.delta-backend.com/stac/tiles/WebMercatorQuad/{z}/{x}/{y}?collection=%s%s&assets=red&assets=green&assets=blue&color_formula=gamma RGB 2.7, saturation 1.5, sigmoidal RGB 15 0.55&nodata=0&format=png"%(endpoint["CollectionId"], item_kvp)
if target_url:
stac_object.add_link(
Link(
Expand Down Expand Up @@ -976,7 +974,7 @@ def generate_thumbnail(stac_object, data, endpoint, file_url=None, time=None, st
)
fetch_and_save_thumbnail(data, url)
elif endpoint["Name"] == "VEDA":
target_url = generate_veda_link(endpoint, file_url)
target_url = generate_veda_cog_link(endpoint, file_url)
# set to get 0/0/0 tile
url = re.sub(r"\{.\}", "0", target_url)
fetch_and_save_thumbnail(data, url)
Expand Down

0 comments on commit 734c6e6

Please sign in to comment.