Spaces:
Running
Running
Daniele Castellana
commited on
Commit
·
91508a4
1
Parent(s):
4625f74
Revert "Incorporate deployment to streamlit cloud (#4)" (#5)
Browse filesThis reverts commit 4625f74ee5b48eddcfbcdeeaa4bc62b334194546.
- app/src/utils_ee.py +2 -13
app/src/utils_ee.py
CHANGED
@@ -1,20 +1,9 @@
|
|
1 |
"""Module for ee-related functionalities."""
|
2 |
-
import os
|
3 |
-
|
4 |
import ee
|
5 |
import streamlit as st
|
6 |
-
from ee import oauth
|
7 |
-
from google.oauth2 import service_account
|
8 |
|
9 |
|
10 |
-
@st.
|
11 |
def ee_initialize():
|
12 |
"""Initialise Google Earth Engine."""
|
13 |
-
|
14 |
-
service_account_keys = st.secrets["ee_keys"]
|
15 |
-
credentials = service_account.Credentials.from_service_account_info(
|
16 |
-
service_account_keys, scopes=oauth.SCOPES
|
17 |
-
)
|
18 |
-
ee.Initialize(credentials)
|
19 |
-
else:
|
20 |
-
ee.Initialize()
|
|
|
1 |
"""Module for ee-related functionalities."""
|
|
|
|
|
2 |
import ee
|
3 |
import streamlit as st
|
|
|
|
|
4 |
|
5 |
|
6 |
+
@st.cache
|
7 |
def ee_initialize():
|
8 |
"""Initialise Google Earth Engine."""
|
9 |
+
ee.Initialize()
|
|
|
|
|
|
|
|
|
|
|
|
|
|