Spaces:
Build error
Build error
jordancaraballo
commited on
Commit
β’
a8bdcd5
1
Parent(s):
cd55fe8
Adding folium page
Browse files- Dockerfile +1 -2
- pages/pages/2_π_Alaska_WRF.py +36 -44
Dockerfile
CHANGED
@@ -9,9 +9,8 @@ RUN rm -rf /etc/apt/sources.list.d/*.list && \
|
|
9 |
RUN python3 -m pip install --upgrade pip setuptools wheel
|
10 |
|
11 |
COPY requirements.txt .
|
12 |
-
RUN python3 -m pip install --upgrade pip setuptools wheel cython numpy pyshp six pyproj
|
13 |
RUN python3 -m pip install --upgrade --no-binary :all: shapely
|
14 |
-
#RUN python3 -m pip install git+https://github.com/SciTools/cartopy.git --upgrade --no-binary :all: cartopy
|
15 |
RUN python3 -m pip install git+https://github.com/SciTools/cartopy.git --upgrade cartopy
|
16 |
|
17 |
RUN python3 -m pip install --no-cache-dir --compile -r requirements.txt
|
|
|
9 |
RUN python3 -m pip install --upgrade pip setuptools wheel
|
10 |
|
11 |
COPY requirements.txt .
|
12 |
+
RUN python3 -m pip install --upgrade pip setuptools wheel cython numpy pyshp six pyproj streamlit-folium
|
13 |
RUN python3 -m pip install --upgrade --no-binary :all: shapely
|
|
|
14 |
RUN python3 -m pip install git+https://github.com/SciTools/cartopy.git --upgrade cartopy
|
15 |
|
16 |
RUN python3 -m pip install --no-cache-dir --compile -r requirements.txt
|
pages/pages/2_π_Alaska_WRF.py
CHANGED
@@ -1,44 +1,36 @@
|
|
1 |
-
import
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
on_zoom=zoom.set,
|
38 |
-
center=center.value,
|
39 |
-
on_center=center.set,
|
40 |
-
scroll_wheel_zoom=True,
|
41 |
-
|
42 |
-
)
|
43 |
-
solara.Text(f"Zoom: {zoom.value}")
|
44 |
-
solara.Text(f"Center: {center.value}")
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
st.set_page_config(
|
4 |
+
page_title="streamlit-folium documentation: Draw Support",
|
5 |
+
page_icon=":pencil:",
|
6 |
+
layout="wide",
|
7 |
+
)
|
8 |
+
|
9 |
+
"""
|
10 |
+
# streamlit-folium: Draw Support
|
11 |
+
|
12 |
+
Folium supports some of the [most popular leaflet plugins](https://python-visualization.github.io/folium/plugins.html). In this example,
|
13 |
+
we can add the [`Draw`](https://python-visualization.github.io/folium/plugins.html#folium.plugins.Draw) plugin to our map, which allows for drawing geometric shapes on the map.
|
14 |
+
|
15 |
+
When a shape is drawn on the map, the coordinates that represent that shape are passed back as a geojson feature via
|
16 |
+
the `all_drawings` and `last_active_drawing` data fields.
|
17 |
+
|
18 |
+
Draw something below to see the return value back to Streamlit!
|
19 |
+
"""
|
20 |
+
|
21 |
+
with st.echo(code_location="below"):
|
22 |
+
import folium
|
23 |
+
import streamlit as st
|
24 |
+
from folium.plugins import Draw
|
25 |
+
|
26 |
+
from streamlit_folium import st_folium
|
27 |
+
|
28 |
+
m = folium.Map(location=[39.949610, -75.150282], zoom_start=5)
|
29 |
+
Draw(export=True).add_to(m)
|
30 |
+
|
31 |
+
c1, c2 = st.columns(2)
|
32 |
+
with c1:
|
33 |
+
output = st_folium(m, width=700, height=500)
|
34 |
+
|
35 |
+
with c2:
|
36 |
+
st.write(output)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|