Abdulahad79 commited on
Commit
d5dbc69
·
verified ·
1 Parent(s): 79a8a5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -20,15 +20,15 @@ from datetime import datetime, timedelta
20
  import rasterio
21
  from rasterio.transform import xy
22
 
23
- # Absolute path to your credentials file (update this if needed)
24
- CREDENTIALS_PATH = "credentials" # Windows
 
25
 
26
  try:
27
- # Use OAuth credentials from file
28
- credentials = ee.OAuthCredentials(None, CREDENTIALS_PATH)
29
- ee.Initialize(credentials, project='your-project-id') # Replace with your actual project ID
30
  except Exception as e:
31
- print(f"Error initializing GEE: {str(e)}")
32
 
33
  # Define crop season dictionary
34
  crop_season_dict = {
 
20
  import rasterio
21
  from rasterio.transform import xy
22
 
23
+
24
+ # Tell Earth Engine to use your local credentials file
25
+ os.environ['EARTHENGINE_TOKEN'] = 'credentials' # relative path or use full path if needed
26
 
27
  try:
28
+ ee.Initialize(project='artful-striker-466710-b3') # Replace with your actual GEE project ID
29
+ print("Earth Engine initialized successfully.")
 
30
  except Exception as e:
31
+ print(f"Error initializing Earth Engine: {e}")
32
 
33
  # Define crop season dictionary
34
  crop_season_dict = {