YashMK89 commited on
Commit
30dd757
·
verified ·
1 Parent(s): 5cb85a9

update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -21
app.py CHANGED
@@ -184,28 +184,8 @@ def calculate_custom_formula(image, geometry, formula):
184
  )
185
  return result.get('Custom Index')
186
 
187
- # # Function to reset session state when a new file is uploaded
188
- # def reset_session_state_for_new_file():
189
- # if 'results' in st.session_state:
190
- # st.session_state.results = [] # Clear previous results
191
-
192
- # if 'map_data' in st.session_state:
193
- # st.session_state.map_data = None # Clear previous map data
194
-
195
- # if 'file_upload' in st.session_state:
196
- # st.session_state.file_upload = None # Clear the previous file upload
197
-
198
- # # Ask user to upload a file based on shape type (case-insensitive)
199
- # file_upload = st.file_uploader(f"Upload your {shape_type} data (CSV, GeoJSON, KML)", type=["csv", "geojson", "kml"])
200
-
201
- # Check if the file uploaded is different from the previous file uploaded
202
- if 'file_upload' in st.session_state and st.session_state.file_upload != file_upload:
203
- reset_session_state_for_new_file() # Reset session state for new file
204
-
205
- # Store the current file upload in session state
206
  if file_upload:
207
- st.session_state.file_upload = file_upload # Store the uploaded file in session state
208
-
209
  locations_df = None # Initialize locations_df to None
210
  polygons_df = None # Initialize polygons_df to None
211
 
 
184
  )
185
  return result.get('Custom Index')
186
 
187
+ # Process each point or polygon
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  if file_upload:
 
 
189
  locations_df = None # Initialize locations_df to None
190
  polygons_df = None # Initialize polygons_df to None
191