Skip to content

Commit

Permalink
deploy: 9164112
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jun 15, 2024
1 parent d7fff13 commit 865fdae
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions auto_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
df.to_csv("datasets.tsv", sep="\t", index=False)

0 comments on commit 865fdae

Please sign in to comment.