Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,7 @@ sys.path.append(parent_dir)
|
|
| 11 |
|
| 12 |
import ee
|
| 13 |
# Add Google Service account credential. Authenticates to the Earth Engine servers.
|
| 14 |
-
|
| 15 |
-
key_dict = json.loads(os.environ.get("SERVICE_JSON"))
|
| 16 |
-
credentials = ee.ServiceAccountCredentials(service_account, key_data=key_dict)
|
| 17 |
|
| 18 |
import math
|
| 19 |
from shiny import App, render, ui, reactive, Inputs, Outputs, Session
|
|
@@ -150,8 +148,10 @@ def runModel(input_data, scaler_X, scaler_Y, ANNmodel):
|
|
| 150 |
|
| 151 |
return datasets
|
| 152 |
|
|
|
|
|
|
|
| 153 |
def getGPS():
|
| 154 |
-
GPSurl =
|
| 155 |
data = {'homeMobileCountryCode': 310, 'homeMobileNetworkCode': 410, 'considerIp': 'True'}
|
| 156 |
response = requests.post(GPSurl, data=json.dumps(data))
|
| 157 |
result = json.loads(response.content)
|
|
|
|
| 11 |
|
| 12 |
import ee
|
| 13 |
# Add Google Service account credential. Authenticates to the Earth Engine servers.
|
| 14 |
+
credentials = ee.ServiceAccountCredentials(os.environ.get("SERVICE_EMAIL"), os.environ.get("SERVICE_JSON"))
|
|
|
|
|
|
|
| 15 |
|
| 16 |
import math
|
| 17 |
from shiny import App, render, ui, reactive, Inputs, Outputs, Session
|
|
|
|
| 148 |
|
| 149 |
return datasets
|
| 150 |
|
| 151 |
+
gpsurl = 'https://www.googleapis.com/geolocation/v1/geolocate?key=' + os.environ.get("GMAP_TOKEN")
|
| 152 |
+
|
| 153 |
def getGPS():
|
| 154 |
+
GPSurl = gpsurl
|
| 155 |
data = {'homeMobileCountryCode': 310, 'homeMobileNetworkCode': 410, 'considerIp': 'True'}
|
| 156 |
response = requests.post(GPSurl, data=json.dumps(data))
|
| 157 |
result = json.loads(response.content)
|