From 865fdae5105df17a073dca041a1c9ea6a4ee501a Mon Sep 17 00:00:00 2001 From: giswqs Date: Sat, 15 Jun 2024 03:15:30 +0000 Subject: [PATCH] deploy: 916411246ee678a7a0583139fa35b3c7b41ee667 --- auto_update.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/auto_update.py b/auto_update.py index 1471bbf..9a1a119 100644 --- a/auto_update.py +++ b/auto_update.py @@ -4,22 +4,22 @@ import pandas as pd from geemap.ee_tile_layers import _get_tile_url_format, _validate_palette -geemap.ee_initialize() +geemap.ee_initialize(service_account=True) -df = pd.read_csv('datasets.tsv', sep='\t') +df = pd.read_csv("datasets.tsv", sep="\t") for index, row in df.iterrows(): print(f"{index}: {row['id']}") try: - ee_object = eval(row['snippet']) - vis_params = eval(row['vis']) - if 'palette' in vis_params: - vis_params['palette'] = _validate_palette(vis_params['palette']) + ee_object = eval(row["snippet"]) + vis_params = eval(row["vis"]) + if "palette" in vis_params: + vis_params["palette"] = _validate_palette(vis_params["palette"]) url = _get_tile_url_format(ee_object, vis_params) - row['url'] = url - row['modified'] = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) + row["url"] = url + row["modified"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) except Exception as e: print(e) - row['url'] = None + row["url"] = None -df.to_csv('datasets.tsv', sep='\t', index=False) \ No newline at end of file +df.to_csv("datasets.tsv", sep="\t", index=False)