Esmaeilkiani commited on
Commit
032cf90
1 Parent(s): 58d6179

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -71,10 +71,11 @@ selected_farm_data = farm_data[farm_data['Farm'] == selected_farm]
71
  coordinates = (selected_farm_data['longitude'].iloc[0], selected_farm_data['latitude'].iloc[0])
72
 
73
 
74
- if st.button("Calculate NDRE and Show Map"):
75
- ndre_value = calculate_ndre(coordinates, start_date.strftime("%Y-%m-%d"), end_date.strftime("%Y-%m-%d"))
76
- if ndre_value is not None:
77
- st.write(f"NDRE Value: {ndre_value}")
 
78
  # Map Display (Replace with your actual map display logic)
79
  Map = geemap.Map()
80
  Map.centerObject(ee.Geometry.Point(coordinates), 12)
 
71
  coordinates = (selected_farm_data['longitude'].iloc[0], selected_farm_data['latitude'].iloc[0])
72
 
73
 
74
+ # Inside the 'نمایش نقشه NDRE' button's code block
75
+ if st.button('نمایش نقشه NDRE'):
76
+ # Call the function and store the returned value in 'NDRE'
77
+ NDRE = calculate_ndre(coordinates, start_date, end_date)
78
+ st.write(f'شاخص NDRE: {NDRE}')
79
  # Map Display (Replace with your actual map display logic)
80
  Map = geemap.Map()
81
  Map.centerObject(ee.Geometry.Point(coordinates), 12)