Dingyi6 commited on
Commit
db0a405
·
1 Parent(s): da80845

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- service_account = os.environ.get("SERVICE_EMAIL")
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 = 'https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyAnHc2yRD53vlzHrj7qQ6OLFiX-iGsqFyM'
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)