Spaces:
Sleeping
Sleeping
Added demo
Browse files- apps/timelapse.py +11 -10
apps/timelapse.py
CHANGED
@@ -14,8 +14,7 @@ def uploaded_file_to_gdf(data):
|
|
14 |
|
15 |
_, file_extension = os.path.splitext(data.name)
|
16 |
file_id = str(uuid.uuid4())
|
17 |
-
file_path = os.path.join(tempfile.gettempdir(),
|
18 |
-
f"{file_id}{file_extension}")
|
19 |
|
20 |
with open(file_path, "wb") as file:
|
21 |
file.write(data.getbuffer())
|
@@ -35,11 +34,13 @@ def app():
|
|
35 |
|
36 |
st.title("Create Landsat Timelapse")
|
37 |
|
38 |
-
st.markdown(
|
|
|
39 |
An interactive web app for creating timelapse of annual Landsat imagery (1984-2021) for any location around the globe.
|
40 |
The app was built using [streamlit](https://streamlit.io), [geemap](https://geemap.org), and [Google Earth Engine](https://earthengine.google.com).
|
41 |
See a [video demo](https://youtu.be/VVRK_-dEjR4).
|
42 |
-
"""
|
|
|
43 |
|
44 |
row1_col1, row1_col2 = st.columns([2, 1])
|
45 |
|
@@ -47,6 +48,9 @@ def app():
|
|
47 |
m = geemap.Map(basemap="HYBRID", plugin_Draw=True, draw_export=True)
|
48 |
m.add_basemap("ROADMAP")
|
49 |
|
|
|
|
|
|
|
50 |
data = st.file_uploader(
|
51 |
"Draw a small ROI on the map, click the Export button to save it, and then upload it here. Customize timelapse parameters and then click the Submit button 😇👇",
|
52 |
type=["geojson"],
|
@@ -107,11 +111,9 @@ def app():
|
|
107 |
with st.expander("Customize timelapse"):
|
108 |
|
109 |
speed = st.slider("Frames/sec:", 1, 30, 10)
|
110 |
-
progress_bar_color = st.color_picker(
|
111 |
-
"Progress bar color:", "#0000ff")
|
112 |
years = st.slider(
|
113 |
-
"Start and end year:", 1984, today.year, (
|
114 |
-
1984, today.year - 1)
|
115 |
)
|
116 |
months = st.slider("Start and end month:", 1, 12, (5, 10))
|
117 |
font_size = st.slider("Font size:", 10, 50, 30)
|
@@ -171,6 +173,5 @@ def app():
|
|
171 |
|
172 |
geemap.reduce_gif_size(out_gif)
|
173 |
|
174 |
-
empty_text.text(
|
175 |
-
"Right click the image to save it to your computer👇")
|
176 |
empty_image.image(out_gif)
|
|
|
14 |
|
15 |
_, file_extension = os.path.splitext(data.name)
|
16 |
file_id = str(uuid.uuid4())
|
17 |
+
file_path = os.path.join(tempfile.gettempdir(), f"{file_id}{file_extension}")
|
|
|
18 |
|
19 |
with open(file_path, "wb") as file:
|
20 |
file.write(data.getbuffer())
|
|
|
34 |
|
35 |
st.title("Create Landsat Timelapse")
|
36 |
|
37 |
+
st.markdown(
|
38 |
+
"""
|
39 |
An interactive web app for creating timelapse of annual Landsat imagery (1984-2021) for any location around the globe.
|
40 |
The app was built using [streamlit](https://streamlit.io), [geemap](https://geemap.org), and [Google Earth Engine](https://earthengine.google.com).
|
41 |
See a [video demo](https://youtu.be/VVRK_-dEjR4).
|
42 |
+
"""
|
43 |
+
)
|
44 |
|
45 |
row1_col1, row1_col2 = st.columns([2, 1])
|
46 |
|
|
|
48 |
m = geemap.Map(basemap="HYBRID", plugin_Draw=True, draw_export=True)
|
49 |
m.add_basemap("ROADMAP")
|
50 |
|
51 |
+
with st.expander("See a video demo"):
|
52 |
+
st.video("https://youtu.be/VVRK_-dEjR4")
|
53 |
+
|
54 |
data = st.file_uploader(
|
55 |
"Draw a small ROI on the map, click the Export button to save it, and then upload it here. Customize timelapse parameters and then click the Submit button 😇👇",
|
56 |
type=["geojson"],
|
|
|
111 |
with st.expander("Customize timelapse"):
|
112 |
|
113 |
speed = st.slider("Frames/sec:", 1, 30, 10)
|
114 |
+
progress_bar_color = st.color_picker("Progress bar color:", "#0000ff")
|
|
|
115 |
years = st.slider(
|
116 |
+
"Start and end year:", 1984, today.year, (1984, today.year - 1)
|
|
|
117 |
)
|
118 |
months = st.slider("Start and end month:", 1, 12, (5, 10))
|
119 |
font_size = st.slider("Font size:", 10, 50, 30)
|
|
|
173 |
|
174 |
geemap.reduce_gif_size(out_gif)
|
175 |
|
176 |
+
empty_text.text("Right click the image to save it to your computer👇")
|
|
|
177 |
empty_image.image(out_gif)
|