Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,15 @@ import fiona
|
|
15 |
fiona.drvsupport.supported_drivers['LIBKML'] = 'rw'
|
16 |
|
17 |
#Intialize EE library
|
18 |
-
|
|
|
|
|
|
|
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(
|
22 |
-
ee.Initialize()
|
23 |
|
24 |
-
|
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
|