UjjwalKGupta commited on
Commit
c0206c3
·
verified ·
1 Parent(s): 2276dbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -15,14 +15,15 @@ import fiona
15
  fiona.drvsupport.supported_drivers['LIBKML'] = 'rw'
16
 
17
  #Intialize EE library
18
- ee_credentials = os.environ.get("EE")
 
 
 
19
  os.makedirs(os.path.expanduser("~/.config/earthengine/"), exist_ok=True)
20
  with open(os.path.expanduser("~/.config/earthengine/credentials"), "w") as f:
21
- f.write(ee_credentials)
22
- ee.Initialize()
23
 
24
- # ee.Authenticate()
25
- # ee.Initialize()
26
 
27
  # Functions
28
  def convert_to_2d_geometry(geom): #Handles Polygon Only
 
15
  fiona.drvsupport.supported_drivers['LIBKML'] = 'rw'
16
 
17
  #Intialize EE library
18
+ # Access secret
19
+ earthengine_credentials = os.environ.get("EE_Authentication")
20
+
21
+ # Initialize Earth Engine with the secret credentials
22
  os.makedirs(os.path.expanduser("~/.config/earthengine/"), exist_ok=True)
23
  with open(os.path.expanduser("~/.config/earthengine/credentials"), "w") as f:
24
+ f.write(earthengine_credentials)
 
25
 
26
+ ee.Initialize()
 
27
 
28
  # Functions
29
  def convert_to_2d_geometry(geom): #Handles Polygon Only