Spaces:
Running
Running
File size: 563 Bytes
81b61a4 c5cc81a 62b4495 81b61a4 c5cc81a 81b61a4 19b905a c5cc81a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
"""Module for ee-related functionalities."""
import ee
import streamlit as st
from ee import oauth
from google.oauth2 import service_account
from src.utils import is_app_on_streamlit
@st.experimental_memo
def ee_initialize():
"""Initialise Google Earth Engine."""
if is_app_on_streamlit():
service_account_keys = st.secrets["ee_keys"]
credentials = service_account.Credentials.from_service_account_info(
service_account_keys, scopes=oauth.SCOPES
)
ee.Initialize(credentials)
else:
ee.Initialize()
|