giswqs commited on
Commit
f2cf4fa
β€’
1 Parent(s): 9ad0e2d

Update st.cache

Browse files
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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.cache
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.cache
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.cache
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.cache
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.cache
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.cache
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.cache
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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.cache(persist=True)
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.cache(persist=True)
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://geospatial.streamlitapp.com>
27
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
28
  """
29
  )
30
 
@@ -207,7 +206,7 @@ ocean_rois = {
207
  }
208
 
209
 
210
- @st.cache(allow_output_mutation=True)
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://geospatial.streamlitapp.com>
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.cache
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.cache
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
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://geospatial.streamlitapp.com>
11
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
12
  """
13
  )
14
 
@@ -21,7 +20,7 @@ st.sidebar.info(
21
  )
22
 
23
 
24
- @st.cache
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://geospatial.streamlitapp.com>
12
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
13
  """
14
  )
15
 
@@ -22,7 +21,7 @@ st.sidebar.info(
22
  )
23
 
24
 
25
- @st.cache
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.cache
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://geospatial.streamlitapp.com>
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==1.12.2
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://geospatial.streamlitapp.com>
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