Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,17 @@ sys.path.append(parent_dir)
|
|
| 10 |
import ee
|
| 11 |
# ee.Authenticate()
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
import math
|
| 14 |
from shiny import App, render, ui, reactive, Inputs, Outputs, Session
|
| 15 |
import ipyleaflet as L
|
|
@@ -265,17 +276,6 @@ def server(input, output, session):
|
|
| 265 |
|
| 266 |
ui.modal_show(m)
|
| 267 |
|
| 268 |
-
# Add Google Service account credential. Authenticates to the Earth Engine servers.
|
| 269 |
-
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'ee-yudingyi054-64e93ae89dc1.json'
|
| 270 |
-
|
| 271 |
-
if 'GOOGLE_APPLICATION_CREDENTIALS' in os.environ:
|
| 272 |
-
print("GOOGLE_APPLICATION_CREDENTIALS set to:", os.environ['GOOGLE_APPLICATION_CREDENTIALS'])
|
| 273 |
-
else:
|
| 274 |
-
print("GOOGLE_APPLICATION_CREDENTIALS is not set")
|
| 275 |
-
|
| 276 |
-
# Initialize Earth Engine
|
| 277 |
-
ee.Initialize()
|
| 278 |
-
|
| 279 |
# Check API status
|
| 280 |
asset_roots = ee.data.getAssetRoots()
|
| 281 |
if asset_roots:
|
|
|
|
| 10 |
import ee
|
| 11 |
# ee.Authenticate()
|
| 12 |
|
| 13 |
+
# Add Google Service account credential. Authenticates to the Earth Engine servers.
|
| 14 |
+
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'ee-yudingyi054-64e93ae89dc1.json'
|
| 15 |
+
|
| 16 |
+
if 'GOOGLE_APPLICATION_CREDENTIALS' in os.environ:
|
| 17 |
+
print("GOOGLE_APPLICATION_CREDENTIALS set to:", os.environ['GOOGLE_APPLICATION_CREDENTIALS'])
|
| 18 |
+
else:
|
| 19 |
+
print("GOOGLE_APPLICATION_CREDENTIALS is not set")
|
| 20 |
+
|
| 21 |
+
# Initialize Earth Engine
|
| 22 |
+
ee.Initialize()
|
| 23 |
+
|
| 24 |
import math
|
| 25 |
from shiny import App, render, ui, reactive, Inputs, Outputs, Session
|
| 26 |
import ipyleaflet as L
|
|
|
|
| 276 |
|
| 277 |
ui.modal_show(m)
|
| 278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
# Check API status
|
| 280 |
asset_roots = ee.data.getAssetRoots()
|
| 281 |
if asset_roots:
|