From 734c6e6ec76f1e3531af6ce88ca693c826f1e657 Mon Sep 17 00:00:00 2001 From: santilland Date: Thu, 15 Feb 2024 17:23:07 +0100 Subject: [PATCH] fix: removed static overwrite of veda tiles config, fixed wrong call to renamed method --- generators/generate_indicators.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/generators/generate_indicators.py b/generators/generate_indicators.py index f4faf814..8210cc4b 100644 --- a/generators/generate_indicators.py +++ b/generators/generate_indicators.py @@ -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 @@ -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, @@ -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( @@ -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)