YashMK89 commited on
Commit
f4b0045
·
verified ·
1 Parent(s): f1840fc

update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import streamlit as st
2
  import json
 
 
3
 
4
 
5
  st.set_page_config(layout="wide")
@@ -14,13 +16,15 @@ div.stButton > button:first-child {
14
  unsafe_allow_html=True,
15
  )
16
 
17
- import streamlit as st
18
- import json
19
- import ee
20
- import geemap
 
 
 
21
 
22
- # Initialize the Earth Engine library
23
- ee.Initialize()
24
 
25
  # Load JSON data for Sentinel dataset options
26
  with open("sentinel_datasets.json") as f:
 
1
  import streamlit as st
2
  import json
3
+ import ee
4
+ import geemap
5
 
6
 
7
  st.set_page_config(layout="wide")
 
16
  unsafe_allow_html=True,
17
  )
18
 
19
+ # Authenticate and initialize Earth Engine
20
+ earthengine_credentials = os.environ.get("EE_Authentication")
21
+
22
+ # Initialize Earth Engine with the secret credentials
23
+ os.makedirs(os.path.expanduser("~/.config/earthengine/"), exist_ok=True)
24
+ with open(os.path.expanduser("~/.config/earthengine/credentials"), "w") as f:
25
+ f.write(earthengine_credentials)
26
 
27
+ ee.Initialize(project='ee-yashsacisro24')
 
28
 
29
  # Load JSON data for Sentinel dataset options
30
  with open("sentinel_datasets.json") as f: