Spaces:
Sleeping
Sleeping
Lode Nachtergaele commited on
Commit ·
8869d68
1
Parent(s): 90b65d1
remove folium
Browse files- app.py +15 -14
- requirements.txt +4 -4
app.py
CHANGED
|
@@ -9,8 +9,9 @@ import numpy as np
|
|
| 9 |
import pandas as pd
|
| 10 |
from scipy.signal import find_peaks
|
| 11 |
import streamlit as st
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
import altair as alt
|
| 15 |
from io import StringIO
|
| 16 |
|
|
@@ -211,9 +212,9 @@ def generate_height_profile_json(df: pd.DataFrame) -> str:
|
|
| 211 |
)
|
| 212 |
)
|
| 213 |
chart = (
|
| 214 |
-
(elevation + line_peaks)
|
| 215 |
-
# .properties(width=
|
| 216 |
-
.
|
| 217 |
strokeWidth=0,
|
| 218 |
)
|
| 219 |
)
|
|
@@ -225,14 +226,14 @@ gpx_file = st.file_uploader("Upload gpx file", type=["gpx"])
|
|
| 225 |
if gpx_file is not None:
|
| 226 |
ave_lat, ave_lon, lon_list, lat_list, h_list = get_gpx(gpx_file)
|
| 227 |
df = pd.DataFrame({"lon": lon_list, "lat": lat_list, "elev": h_list})
|
| 228 |
-
route_map = folium.Map(
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
)
|
| 232 |
-
folium.PolyLine(
|
| 233 |
-
|
| 234 |
-
).add_to(route_map)
|
| 235 |
-
st_data = st_folium(route_map, height=450, width=850)
|
| 236 |
chart = generate_height_profile_json(df)
|
| 237 |
|
| 238 |
-
st.altair_chart(chart, use_container_width=
|
|
|
|
| 9 |
import pandas as pd
|
| 10 |
from scipy.signal import find_peaks
|
| 11 |
import streamlit as st
|
| 12 |
+
|
| 13 |
+
# import folium
|
| 14 |
+
# from streamlit_folium import st_folium
|
| 15 |
import altair as alt
|
| 16 |
from io import StringIO
|
| 17 |
|
|
|
|
| 212 |
)
|
| 213 |
)
|
| 214 |
chart = (
|
| 215 |
+
(elevation + line_peaks).properties(width="container")
|
| 216 |
+
# .properties(height=100, width=750)
|
| 217 |
+
.configure_view(
|
| 218 |
strokeWidth=0,
|
| 219 |
)
|
| 220 |
)
|
|
|
|
| 226 |
if gpx_file is not None:
|
| 227 |
ave_lat, ave_lon, lon_list, lat_list, h_list = get_gpx(gpx_file)
|
| 228 |
df = pd.DataFrame({"lon": lon_list, "lat": lat_list, "elev": h_list})
|
| 229 |
+
# route_map = folium.Map(
|
| 230 |
+
# location=[ave_lat, ave_lon],
|
| 231 |
+
# zoom_start=12,
|
| 232 |
+
# )
|
| 233 |
+
# folium.PolyLine(
|
| 234 |
+
# list(zip(lat_list, lon_list)), color="red", weight=2.5, opacity=1
|
| 235 |
+
# ).add_to(route_map)
|
| 236 |
+
# st_data = st_folium(route_map, height=450, width=850)
|
| 237 |
chart = generate_height_profile_json(df)
|
| 238 |
|
| 239 |
+
st.altair_chart(chart, use_container_width=True)
|
requirements.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
streamlit==1.24.0
|
| 2 |
-
folium==0.14.0
|
| 3 |
-
streamlit-folium==0.12.0
|
| 4 |
-
altair==5.0.1
|
| 5 |
-
pandas==2.0.3
|
| 6 |
scipy==1.11.1
|
|
|
|
| 1 |
streamlit==1.24.0
|
| 2 |
+
# folium==0.14.0
|
| 3 |
+
# streamlit-folium==0.12.0
|
| 4 |
+
# altair==5.0.1
|
| 5 |
+
# pandas==2.0.3
|
| 6 |
scipy==1.11.1
|