Update st.cache
Browse files- Home.py +2 -2
- app.py +2 -3
- apps/housing.py +2 -2
- apps/hurricane.py +1 -1
- apps/raster.py +2 -2
- apps/timelapse.py +1 -1
- apps/wms.py +1 -1
- pages/10_π_Earth_Engine_Datasets.py +2 -3
- pages/11_π§±_Ordnance_Survey.py +2 -3
- pages/12_π²_Land_Cover_Mapping.py +2 -3
- pages/13_ποΈ_Global_Building_Footprints.py +3 -4
- pages/1_π·_Timelapse.py +4 -5
- pages/2_π _U.S._Housing.py +4 -5
- pages/3_πͺ_Split_Map.py +2 -3
- pages/4_π₯_Heatmap.py +2 -3
- pages/5_π_Marker_Cluster.py +2 -3
- pages/6_πΊοΈ_Basemaps.py +2 -3
- pages/7_π¦_Web_Map_Service.py +3 -4
- pages/8_ποΈ_Raster_Data_Visualization.py +4 -5
- pages/9_π²_Vector_Data_Visualization.py +2 -3
- requirements.txt +1 -1
- streamlit_app.py +2 -3
Home.py
CHANGED
@@ -6,8 +6,8 @@ st.set_page_config(layout="wide")
|
|
6 |
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
6 |
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
+
- Web App URL: <https://streamlit.geemap.org>
|
10 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
app.py
CHANGED
@@ -3,11 +3,10 @@ import leafmap.foliumap as leafmap
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
6 |
st.sidebar.info(
|
7 |
"""
|
8 |
+
- Web App URL: <https://streamlit.geemap.org>
|
9 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
10 |
"""
|
11 |
)
|
12 |
|
apps/housing.py
CHANGED
@@ -80,7 +80,7 @@ def get_data_columns(df, category, frequency="monthly"):
|
|
80 |
return cols[1:]
|
81 |
|
82 |
|
83 |
-
@st.
|
84 |
def get_inventory_data(url):
|
85 |
df = pd.read_csv(url)
|
86 |
url = url.lower()
|
@@ -124,7 +124,7 @@ def get_periods(df):
|
|
124 |
return [str(d) for d in list(set(df["month_date_yyyymm"].tolist()))]
|
125 |
|
126 |
|
127 |
-
@st.
|
128 |
def get_geom_data(category):
|
129 |
|
130 |
prefix = (
|
|
|
80 |
return cols[1:]
|
81 |
|
82 |
|
83 |
+
@st.cache_data
|
84 |
def get_inventory_data(url):
|
85 |
df = pd.read_csv(url)
|
86 |
url = url.lower()
|
|
|
124 |
return [str(d) for d in list(set(df["month_date_yyyymm"].tolist()))]
|
125 |
|
126 |
|
127 |
+
@st.cache_data
|
128 |
def get_geom_data(category):
|
129 |
|
130 |
prefix = (
|
apps/hurricane.py
CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
|
|
2 |
import tropycal.tracks as tracks
|
3 |
|
4 |
|
5 |
-
@st.
|
6 |
def read_data(basin='north_atlantic', source='hurdat', include_btk=False):
|
7 |
return tracks.TrackDataset(basin=basin, source=source, include_btk=include_btk)
|
8 |
|
|
|
2 |
import tropycal.tracks as tracks
|
3 |
|
4 |
|
5 |
+
@st.cache_data
|
6 |
def read_data(basin='north_atlantic', source='hurdat', include_btk=False):
|
7 |
return tracks.TrackDataset(basin=basin, source=source, include_btk=include_btk)
|
8 |
|
apps/raster.py
CHANGED
@@ -4,7 +4,7 @@ import streamlit as st
|
|
4 |
import palettable
|
5 |
|
6 |
|
7 |
-
@st.
|
8 |
def load_cog_list():
|
9 |
print(os.getcwd())
|
10 |
in_txt = os.path.join(os.getcwd(), "data/cog_files.txt")
|
@@ -12,7 +12,7 @@ def load_cog_list():
|
|
12 |
return [line.strip() for line in f.readlines()[1:]]
|
13 |
|
14 |
|
15 |
-
@st.
|
16 |
def get_palettes():
|
17 |
palettes = dir(palettable.matplotlib)[:-16]
|
18 |
return ["matplotlib." + p for p in palettes]
|
|
|
4 |
import palettable
|
5 |
|
6 |
|
7 |
+
@st.cache_data
|
8 |
def load_cog_list():
|
9 |
print(os.getcwd())
|
10 |
in_txt = os.path.join(os.getcwd(), "data/cog_files.txt")
|
|
|
12 |
return [line.strip() for line in f.readlines()[1:]]
|
13 |
|
14 |
|
15 |
+
@st.cache_data
|
16 |
def get_palettes():
|
17 |
palettes = dir(palettable.matplotlib)[:-16]
|
18 |
return ["matplotlib." + p for p in palettes]
|
apps/timelapse.py
CHANGED
@@ -11,7 +11,7 @@ from datetime import date
|
|
11 |
from .rois import *
|
12 |
|
13 |
|
14 |
-
@st.
|
15 |
def uploaded_file_to_gdf(data):
|
16 |
import tempfile
|
17 |
import os
|
|
|
11 |
from .rois import *
|
12 |
|
13 |
|
14 |
+
@st.cache_data
|
15 |
def uploaded_file_to_gdf(data):
|
16 |
import tempfile
|
17 |
import os
|
apps/wms.py
CHANGED
@@ -3,7 +3,7 @@ import streamlit as st
|
|
3 |
import leafmap.foliumap as leafmap
|
4 |
|
5 |
|
6 |
-
@st.
|
7 |
def get_layers(url):
|
8 |
options = leafmap.get_wms_layers(url)
|
9 |
return options
|
|
|
3 |
import leafmap.foliumap as leafmap
|
4 |
|
5 |
|
6 |
+
@st.cache_data
|
7 |
def get_layers(url):
|
8 |
options = leafmap.get_wms_layers(url)
|
9 |
return options
|
pages/10_π_Earth_Engine_Datasets.py
CHANGED
@@ -4,11 +4,10 @@ import geemap.foliumap as geemap
|
|
4 |
|
5 |
st.set_page_config(layout="wide")
|
6 |
|
7 |
-
st.sidebar.title("About")
|
8 |
st.sidebar.info(
|
9 |
"""
|
10 |
-
Web App URL: <https://
|
11 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
12 |
"""
|
13 |
)
|
14 |
|
|
|
4 |
|
5 |
st.set_page_config(layout="wide")
|
6 |
|
|
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
+
- Web App URL: <https://streamlit.geemap.org>
|
10 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
pages/11_π§±_Ordnance_Survey.py
CHANGED
@@ -6,11 +6,10 @@ import folium.plugins as plugins
|
|
6 |
|
7 |
st.set_page_config(layout="wide")
|
8 |
|
9 |
-
st.sidebar.title("About")
|
10 |
st.sidebar.info(
|
11 |
"""
|
12 |
-
Web App URL: <https://
|
13 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
14 |
"""
|
15 |
)
|
16 |
|
|
|
6 |
|
7 |
st.set_page_config(layout="wide")
|
8 |
|
|
|
9 |
st.sidebar.info(
|
10 |
"""
|
11 |
+
- Web App URL: <https://streamlit.geemap.org>
|
12 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
13 |
"""
|
14 |
)
|
15 |
|
pages/12_π²_Land_Cover_Mapping.py
CHANGED
@@ -5,11 +5,10 @@ import geemap.foliumap as geemap
|
|
5 |
|
6 |
st.set_page_config(layout="wide")
|
7 |
|
8 |
-
st.sidebar.title("About")
|
9 |
st.sidebar.info(
|
10 |
"""
|
11 |
-
Web App URL: <https://
|
12 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
13 |
"""
|
14 |
)
|
15 |
|
|
|
5 |
|
6 |
st.set_page_config(layout="wide")
|
7 |
|
|
|
8 |
st.sidebar.info(
|
9 |
"""
|
10 |
+
- Web App URL: <https://streamlit.geemap.org>
|
11 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
12 |
"""
|
13 |
)
|
14 |
|
pages/13_ποΈ_Global_Building_Footprints.py
CHANGED
@@ -11,11 +11,10 @@ def ee_authenticate(token_name="EARTHENGINE_TOKEN"):
|
|
11 |
geemap.ee_initialize(token_name=token_name)
|
12 |
|
13 |
|
14 |
-
st.sidebar.title("About")
|
15 |
st.sidebar.info(
|
16 |
"""
|
17 |
-
Web App URL: <https://
|
18 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
19 |
"""
|
20 |
)
|
21 |
|
@@ -32,7 +31,7 @@ st.title("Global Building Footprints")
|
|
32 |
col1, col2 = st.columns([8, 2])
|
33 |
|
34 |
|
35 |
-
@st.
|
36 |
def read_data(url):
|
37 |
return gpd.read_file(url)
|
38 |
|
|
|
11 |
geemap.ee_initialize(token_name=token_name)
|
12 |
|
13 |
|
|
|
14 |
st.sidebar.info(
|
15 |
"""
|
16 |
+
- Web App URL: <https://streamlit.geemap.org>
|
17 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
18 |
"""
|
19 |
)
|
20 |
|
|
|
31 |
col1, col2 = st.columns([8, 2])
|
32 |
|
33 |
|
34 |
+
@st.cache_data
|
35 |
def read_data(url):
|
36 |
return gpd.read_file(url)
|
37 |
|
pages/1_π·_Timelapse.py
CHANGED
@@ -15,16 +15,15 @@ st.set_page_config(layout="wide")
|
|
15 |
warnings.filterwarnings("ignore")
|
16 |
|
17 |
|
18 |
-
@st.
|
19 |
def ee_authenticate(token_name="EARTHENGINE_TOKEN"):
|
20 |
geemap.ee_initialize(token_name=token_name)
|
21 |
|
22 |
|
23 |
-
st.sidebar.title("About")
|
24 |
st.sidebar.info(
|
25 |
"""
|
26 |
-
Web App URL: <https://
|
27 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
28 |
"""
|
29 |
)
|
30 |
|
@@ -207,7 +206,7 @@ ocean_rois = {
|
|
207 |
}
|
208 |
|
209 |
|
210 |
-
@st.
|
211 |
def uploaded_file_to_gdf(data):
|
212 |
import tempfile
|
213 |
import os
|
|
|
15 |
warnings.filterwarnings("ignore")
|
16 |
|
17 |
|
18 |
+
@st.cache_data
|
19 |
def ee_authenticate(token_name="EARTHENGINE_TOKEN"):
|
20 |
geemap.ee_initialize(token_name=token_name)
|
21 |
|
22 |
|
|
|
23 |
st.sidebar.info(
|
24 |
"""
|
25 |
+
- Web App URL: <https://streamlit.geemap.org>
|
26 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
27 |
"""
|
28 |
)
|
29 |
|
|
|
206 |
}
|
207 |
|
208 |
|
209 |
+
@st.cache_data
|
210 |
def uploaded_file_to_gdf(data):
|
211 |
import tempfile
|
212 |
import os
|
pages/2_π _U.S._Housing.py
CHANGED
@@ -12,11 +12,10 @@ from leafmap.common import hex_to_rgb
|
|
12 |
|
13 |
st.set_page_config(layout="wide")
|
14 |
|
15 |
-
st.sidebar.title("About")
|
16 |
st.sidebar.info(
|
17 |
"""
|
18 |
-
Web App URL: <https://
|
19 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
20 |
"""
|
21 |
)
|
22 |
|
@@ -97,7 +96,7 @@ def get_data_columns(df, category, frequency="monthly"):
|
|
97 |
return cols[1:]
|
98 |
|
99 |
|
100 |
-
@st.
|
101 |
def get_inventory_data(url):
|
102 |
df = pd.read_csv(url)
|
103 |
url = url.lower()
|
@@ -141,7 +140,7 @@ def get_periods(df):
|
|
141 |
return [str(d) for d in list(set(df["month_date_yyyymm"].tolist()))]
|
142 |
|
143 |
|
144 |
-
@st.
|
145 |
def get_geom_data(category):
|
146 |
|
147 |
prefix = (
|
|
|
12 |
|
13 |
st.set_page_config(layout="wide")
|
14 |
|
|
|
15 |
st.sidebar.info(
|
16 |
"""
|
17 |
+
- Web App URL: <https://streamlit.geemap.org>
|
18 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
19 |
"""
|
20 |
)
|
21 |
|
|
|
96 |
return cols[1:]
|
97 |
|
98 |
|
99 |
+
@st.cache_data
|
100 |
def get_inventory_data(url):
|
101 |
df = pd.read_csv(url)
|
102 |
url = url.lower()
|
|
|
140 |
return [str(d) for d in list(set(df["month_date_yyyymm"].tolist()))]
|
141 |
|
142 |
|
143 |
+
@st.cache_data
|
144 |
def get_geom_data(category):
|
145 |
|
146 |
prefix = (
|
pages/3_πͺ_Split_Map.py
CHANGED
@@ -3,11 +3,10 @@ import leafmap.foliumap as leafmap
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
6 |
st.sidebar.info(
|
7 |
"""
|
8 |
+
- Web App URL: <https://streamlit.geemap.org>
|
9 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
10 |
"""
|
11 |
)
|
12 |
|
pages/4_π₯_Heatmap.py
CHANGED
@@ -3,11 +3,10 @@ import leafmap.foliumap as leafmap
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
6 |
st.sidebar.info(
|
7 |
"""
|
8 |
+
- Web App URL: <https://streamlit.geemap.org>
|
9 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
10 |
"""
|
11 |
)
|
12 |
|
pages/5_π_Marker_Cluster.py
CHANGED
@@ -3,11 +3,10 @@ import leafmap.foliumap as leafmap
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
6 |
st.sidebar.info(
|
7 |
"""
|
8 |
+
- Web App URL: <https://streamlit.geemap.org>
|
9 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
10 |
"""
|
11 |
)
|
12 |
|
pages/6_πΊοΈ_Basemaps.py
CHANGED
@@ -3,11 +3,10 @@ import leafmap.foliumap as leafmap
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
6 |
st.sidebar.info(
|
7 |
"""
|
8 |
+
- Web App URL: <https://streamlit.geemap.org>
|
9 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
10 |
"""
|
11 |
)
|
12 |
|
pages/7_π¦_Web_Map_Service.py
CHANGED
@@ -4,11 +4,10 @@ import leafmap.foliumap as leafmap
|
|
4 |
|
5 |
st.set_page_config(layout="wide")
|
6 |
|
7 |
-
st.sidebar.title("About")
|
8 |
st.sidebar.info(
|
9 |
"""
|
10 |
-
Web App URL: <https://
|
11 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
12 |
"""
|
13 |
)
|
14 |
|
@@ -21,7 +20,7 @@ st.sidebar.info(
|
|
21 |
)
|
22 |
|
23 |
|
24 |
-
@st.
|
25 |
def get_layers(url):
|
26 |
options = leafmap.get_wms_layers(url)
|
27 |
return options
|
|
|
4 |
|
5 |
st.set_page_config(layout="wide")
|
6 |
|
|
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
+
- Web App URL: <https://streamlit.geemap.org>
|
10 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
20 |
)
|
21 |
|
22 |
|
23 |
+
@st.cache_data
|
24 |
def get_layers(url):
|
25 |
options = leafmap.get_wms_layers(url)
|
26 |
return options
|
pages/8_ποΈ_Raster_Data_Visualization.py
CHANGED
@@ -5,11 +5,10 @@ import streamlit as st
|
|
5 |
|
6 |
st.set_page_config(layout="wide")
|
7 |
|
8 |
-
st.sidebar.title("About")
|
9 |
st.sidebar.info(
|
10 |
"""
|
11 |
-
Web App URL: <https://
|
12 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
13 |
"""
|
14 |
)
|
15 |
|
@@ -22,7 +21,7 @@ st.sidebar.info(
|
|
22 |
)
|
23 |
|
24 |
|
25 |
-
@st.
|
26 |
def load_cog_list():
|
27 |
print(os.getcwd())
|
28 |
in_txt = os.path.join(os.getcwd(), "data/cog_files.txt")
|
@@ -30,7 +29,7 @@ def load_cog_list():
|
|
30 |
return [line.strip() for line in f.readlines()[1:]]
|
31 |
|
32 |
|
33 |
-
@st.
|
34 |
def get_palettes():
|
35 |
return list(cm.palettes.keys())
|
36 |
# palettes = dir(palettable.matplotlib)[:-16]
|
|
|
5 |
|
6 |
st.set_page_config(layout="wide")
|
7 |
|
|
|
8 |
st.sidebar.info(
|
9 |
"""
|
10 |
+
- Web App URL: <https://streamlit.geemap.org>
|
11 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
12 |
"""
|
13 |
)
|
14 |
|
|
|
21 |
)
|
22 |
|
23 |
|
24 |
+
@st.cache_data
|
25 |
def load_cog_list():
|
26 |
print(os.getcwd())
|
27 |
in_txt = os.path.join(os.getcwd(), "data/cog_files.txt")
|
|
|
29 |
return [line.strip() for line in f.readlines()[1:]]
|
30 |
|
31 |
|
32 |
+
@st.cache_data
|
33 |
def get_palettes():
|
34 |
return list(cm.palettes.keys())
|
35 |
# palettes = dir(palettable.matplotlib)[:-16]
|
pages/9_π²_Vector_Data_Visualization.py
CHANGED
@@ -5,11 +5,10 @@ import streamlit as st
|
|
5 |
|
6 |
st.set_page_config(layout="wide")
|
7 |
|
8 |
-
st.sidebar.title("About")
|
9 |
st.sidebar.info(
|
10 |
"""
|
11 |
-
Web App URL: <https://
|
12 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
13 |
"""
|
14 |
)
|
15 |
|
|
|
5 |
|
6 |
st.set_page_config(layout="wide")
|
7 |
|
|
|
8 |
st.sidebar.info(
|
9 |
"""
|
10 |
+
- Web App URL: <https://streamlit.geemap.org>
|
11 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
12 |
"""
|
13 |
)
|
14 |
|
requirements.txt
CHANGED
@@ -10,7 +10,7 @@ nbserverproxy
|
|
10 |
owslib
|
11 |
palettable
|
12 |
plotly
|
13 |
-
streamlit
|
14 |
streamlit-bokeh-events
|
15 |
streamlit-folium
|
16 |
streamlit-keplergl
|
|
|
10 |
owslib
|
11 |
palettable
|
12 |
plotly
|
13 |
+
streamlit
|
14 |
streamlit-bokeh-events
|
15 |
streamlit-folium
|
16 |
streamlit-keplergl
|
streamlit_app.py
CHANGED
@@ -3,11 +3,10 @@ import leafmap.foliumap as leafmap
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
-
st.sidebar.title("About")
|
7 |
st.sidebar.info(
|
8 |
"""
|
9 |
-
Web App URL: <https://
|
10 |
-
GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
11 |
"""
|
12 |
)
|
13 |
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
6 |
st.sidebar.info(
|
7 |
"""
|
8 |
+
- Web App URL: <https://streamlit.geemap.org>
|
9 |
+
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
10 |
"""
|
11 |
)
|
12 |
|