Spaces:
Sleeping
Sleeping
update app.py
Browse files
app.py
CHANGED
@@ -592,17 +592,7 @@ def process_aggregation(locations_df, start_date_str, end_date_str, dataset_id,
|
|
592 |
if st.button(f"Calculate ({index_choice})"):
|
593 |
if file_upload is not None:
|
594 |
# Read the user-uploaded file
|
595 |
-
if shape_type.lower() == "point":
|
596 |
-
if file_upload.name.endswith('.csv'):
|
597 |
-
locations_df = read_csv(file_upload)
|
598 |
-
elif file_upload.name.endswith('.geojson'):
|
599 |
-
locations_df = read_geojson(file_upload)
|
600 |
-
elif file_upload.name.endswith('.kml'):
|
601 |
-
locations_df = read_kml(file_upload)
|
602 |
-
else:
|
603 |
-
st.error("Unsupported file format. Please upload CSV, GeoJSON, or KML.")
|
604 |
-
locations_df = pd.DataFrame()
|
605 |
-
|
606 |
# Process results for the selected aggregation period
|
607 |
results = process_aggregation(
|
608 |
locations_df,
|
@@ -638,11 +628,6 @@ if st.button(f"Calculate ({index_choice})"):
|
|
638 |
st.warning("No results were generated.")
|
639 |
|
640 |
elif shape_type.lower() == "polygon":
|
641 |
-
if file_upload.name.endswith('.geojson'):
|
642 |
-
locations_df = read_geojson(file_upload)
|
643 |
-
else:
|
644 |
-
st.error("Please upload a valid GeoJSON file for polygons.")
|
645 |
-
|
646 |
# Process results for the selected aggregation period
|
647 |
results = process_aggregation(
|
648 |
locations_df,
|
|
|
592 |
if st.button(f"Calculate ({index_choice})"):
|
593 |
if file_upload is not None:
|
594 |
# Read the user-uploaded file
|
595 |
+
if shape_type.lower() == "point":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
# Process results for the selected aggregation period
|
597 |
results = process_aggregation(
|
598 |
locations_df,
|
|
|
628 |
st.warning("No results were generated.")
|
629 |
|
630 |
elif shape_type.lower() == "polygon":
|
|
|
|
|
|
|
|
|
|
|
631 |
# Process results for the selected aggregation period
|
632 |
results = process_aggregation(
|
633 |
locations_df,
|