Spaces:
Running
Running
Removed files
Browse files- Procfile +0 -1
- app-bk.py +0 -49
- app.css +0 -4
- app.py +0 -48
- environment-bk.yml +0 -17
- index.html +0 -39
- multiapp.py +0 -81
- postBuild +0 -6
- setup.sh +0 -18
- streamlit_app.py +0 -43
- streamlit_call.py +0 -14
Procfile
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
web: sh setup.sh && streamlit run Home.py
|
|
|
|
|
|
app-bk.py
DELETED
|
@@ -1,49 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
from multiapp import MultiApp
|
| 3 |
-
from apps import (
|
| 4 |
-
basemaps,
|
| 5 |
-
census,
|
| 6 |
-
cesium,
|
| 7 |
-
deck,
|
| 8 |
-
device_loc,
|
| 9 |
-
gee,
|
| 10 |
-
gee_datasets,
|
| 11 |
-
heatmap,
|
| 12 |
-
home,
|
| 13 |
-
housing,
|
| 14 |
-
# hurricane,
|
| 15 |
-
plotly_maps,
|
| 16 |
-
raster,
|
| 17 |
-
timelapse,
|
| 18 |
-
vector,
|
| 19 |
-
wms,
|
| 20 |
-
xy,
|
| 21 |
-
)
|
| 22 |
-
|
| 23 |
-
st.set_page_config(layout="wide")
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
apps = MultiApp()
|
| 27 |
-
|
| 28 |
-
# Add all your application here
|
| 29 |
-
|
| 30 |
-
apps.add_app("Home", home.app)
|
| 31 |
-
apps.add_app("Create Timelapse", timelapse.app)
|
| 32 |
-
# apps.add_app("Hurricane Mapping", hurricane.app)
|
| 33 |
-
apps.add_app("U.S. Real Estate Data", housing.app)
|
| 34 |
-
apps.add_app("U.S. Census Data", census.app)
|
| 35 |
-
apps.add_app("Visualize Raster Data", raster.app)
|
| 36 |
-
apps.add_app("Visualize Vector Data", vector.app)
|
| 37 |
-
apps.add_app("Search Basemaps", basemaps.app)
|
| 38 |
-
apps.add_app("Pydeck Gallery", deck.app)
|
| 39 |
-
apps.add_app("Heatmaps", heatmap.app)
|
| 40 |
-
apps.add_app("Add Points from XY", xy.app)
|
| 41 |
-
apps.add_app("Add Web Map Service (WMS)", wms.app)
|
| 42 |
-
apps.add_app("Google Earth Engine (GEE)", gee.app)
|
| 43 |
-
apps.add_app("Awesome GEE Community Datasets", gee_datasets.app)
|
| 44 |
-
apps.add_app("Geolocation", device_loc.app)
|
| 45 |
-
apps.add_app("Cesium 3D Map", cesium.app)
|
| 46 |
-
apps.add_app("Plotly", plotly_maps.app)
|
| 47 |
-
|
| 48 |
-
# The main app
|
| 49 |
-
apps.run()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.css
DELETED
|
@@ -1,4 +0,0 @@
|
|
| 1 |
-
.flex
|
| 2 |
-
{
|
| 3 |
-
overflow:auto;
|
| 4 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
DELETED
|
@@ -1,48 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import leafmap.foliumap as leafmap
|
| 3 |
-
|
| 4 |
-
st.set_page_config(layout="wide")
|
| 5 |
-
|
| 6 |
-
st.sidebar.info(
|
| 7 |
-
"""
|
| 8 |
-
- Web App URL: <https://streamlit.gishub.org>
|
| 9 |
-
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
| 10 |
-
"""
|
| 11 |
-
)
|
| 12 |
-
|
| 13 |
-
st.sidebar.title("Contact")
|
| 14 |
-
st.sidebar.info(
|
| 15 |
-
"""
|
| 16 |
-
Qiusheng Wu at [wetlands.io](https://wetlands.io) | [GitHub](https://github.com/giswqs) | [Twitter](https://twitter.com/giswqs) | [YouTube](https://www.youtube.com/c/QiushengWu) | [LinkedIn](https://www.linkedin.com/in/qiushengwu)
|
| 17 |
-
"""
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
st.title("Streamlit for Geospatial Applications")
|
| 21 |
-
|
| 22 |
-
st.markdown(
|
| 23 |
-
"""
|
| 24 |
-
This multi-page web app demonstrates various interactive web apps created using [streamlit](https://streamlit.io) and open-source mapping libraries,
|
| 25 |
-
such as [leafmap](https://leafmap.org), [geemap](https://geemap.org), [pydeck](https://deckgl.readthedocs.io), and [kepler.gl](https://docs.kepler.gl/docs/keplergl-jupyter).
|
| 26 |
-
This is an open-source project and you are very welcome to contribute your comments, questions, resources, and apps as [issues](https://github.com/giswqs/streamlit-geospatial/issues) or
|
| 27 |
-
[pull requests](https://github.com/giswqs/streamlit-geospatial/pulls) to the [GitHub repository](https://github.com/giswqs/streamlit-geospatial).
|
| 28 |
-
|
| 29 |
-
"""
|
| 30 |
-
)
|
| 31 |
-
|
| 32 |
-
st.info("Click on the left sidebar menu to navigate to the different apps.")
|
| 33 |
-
|
| 34 |
-
st.subheader("Timelapse of Satellite Imagery")
|
| 35 |
-
st.markdown(
|
| 36 |
-
"""
|
| 37 |
-
The following timelapse animations were created using the Timelapse web app. Click `Timelapse` on the left sidebar menu to create your own timelapse for any location around the globe.
|
| 38 |
-
"""
|
| 39 |
-
)
|
| 40 |
-
|
| 41 |
-
row1_col1, row1_col2 = st.columns(2)
|
| 42 |
-
with row1_col1:
|
| 43 |
-
st.image("https://github.com/giswqs/data/raw/main/timelapse/spain.gif")
|
| 44 |
-
st.image("https://github.com/giswqs/data/raw/main/timelapse/las_vegas.gif")
|
| 45 |
-
|
| 46 |
-
with row1_col2:
|
| 47 |
-
st.image("https://github.com/giswqs/data/raw/main/timelapse/goes.gif")
|
| 48 |
-
st.image("https://github.com/giswqs/data/raw/main/timelapse/fire.gif")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
environment-bk.yml
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
name: geo
|
| 2 |
-
channels:
|
| 3 |
-
- conda-forge
|
| 4 |
-
dependencies:
|
| 5 |
-
- gdal=3.4.3
|
| 6 |
-
- pip
|
| 7 |
-
- pip:
|
| 8 |
-
- geopandas
|
| 9 |
-
- keplergl
|
| 10 |
-
- streamlit
|
| 11 |
-
- localtileserver
|
| 12 |
-
- palettable
|
| 13 |
-
- streamlit-folium
|
| 14 |
-
- streamlit-keplergl
|
| 15 |
-
- streamlit-bokeh-events
|
| 16 |
-
- git+https://github.com/giswqs/leafmap
|
| 17 |
-
- git+https://github.com/giswqs/geemap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index.html
DELETED
|
@@ -1,39 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html>
|
| 3 |
-
<head>
|
| 4 |
-
<title>Streamlit for Geospatial</title>
|
| 5 |
-
<style type="text/css">
|
| 6 |
-
html {
|
| 7 |
-
overflow: auto;
|
| 8 |
-
}
|
| 9 |
-
html,
|
| 10 |
-
body,
|
| 11 |
-
div,
|
| 12 |
-
iframe {
|
| 13 |
-
margin: 0px;
|
| 14 |
-
padding: 0px;
|
| 15 |
-
height: 100%;
|
| 16 |
-
border: none;
|
| 17 |
-
}
|
| 18 |
-
iframe {
|
| 19 |
-
display: block;
|
| 20 |
-
width: 100%;
|
| 21 |
-
border: none;
|
| 22 |
-
overflow-y: auto;
|
| 23 |
-
overflow-x: hidden;
|
| 24 |
-
}
|
| 25 |
-
</style>
|
| 26 |
-
</head>
|
| 27 |
-
<body>
|
| 28 |
-
<iframe
|
| 29 |
-
src="https://share.streamlit.io/giswqs/streamlit-geospatial/app.py"
|
| 30 |
-
frameborder="0"
|
| 31 |
-
marginheight="0"
|
| 32 |
-
marginwidth="0"
|
| 33 |
-
width="100%"
|
| 34 |
-
height="100%"
|
| 35 |
-
scrolling="auto"
|
| 36 |
-
>
|
| 37 |
-
</iframe>
|
| 38 |
-
</body>
|
| 39 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
multiapp.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
| 1 |
-
"""Frameworks for running multiple Streamlit applications as a single app.
|
| 2 |
-
"""
|
| 3 |
-
import streamlit as st
|
| 4 |
-
|
| 5 |
-
# app_state = st.experimental_get_query_params()
|
| 6 |
-
# app_state = {k: v[0] if isinstance(v, list) else v for k, v in app_state.items()} # fetch the first item in each query string as we don't have multiple values for each query string key in this example
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
class MultiApp:
|
| 10 |
-
"""Framework for combining multiple streamlit applications.
|
| 11 |
-
Usage:
|
| 12 |
-
def foo():
|
| 13 |
-
st.title("Hello Foo")
|
| 14 |
-
def bar():
|
| 15 |
-
st.title("Hello Bar")
|
| 16 |
-
app = MultiApp()
|
| 17 |
-
app.add_app("Foo", foo)
|
| 18 |
-
app.add_app("Bar", bar)
|
| 19 |
-
app.run()
|
| 20 |
-
It is also possible keep each application in a separate file.
|
| 21 |
-
import foo
|
| 22 |
-
import bar
|
| 23 |
-
app = MultiApp()
|
| 24 |
-
app.add_app("Foo", foo.app)
|
| 25 |
-
app.add_app("Bar", bar.app)
|
| 26 |
-
app.run()
|
| 27 |
-
"""
|
| 28 |
-
|
| 29 |
-
def __init__(self):
|
| 30 |
-
self.apps = []
|
| 31 |
-
|
| 32 |
-
def add_app(self, title, func):
|
| 33 |
-
"""Adds a new application.
|
| 34 |
-
Parameters
|
| 35 |
-
----------
|
| 36 |
-
func:
|
| 37 |
-
the python function to render this app.
|
| 38 |
-
title:
|
| 39 |
-
title of the app. Appears in the dropdown in the sidebar.
|
| 40 |
-
"""
|
| 41 |
-
self.apps.append({"title": title, "function": func})
|
| 42 |
-
|
| 43 |
-
def run(self):
|
| 44 |
-
app_state = st.experimental_get_query_params()
|
| 45 |
-
app_state = {
|
| 46 |
-
k: v[0] if isinstance(v, list) else v for k, v in app_state.items()
|
| 47 |
-
} # fetch the first item in each query string as we don't have multiple values for each query string key in this example
|
| 48 |
-
|
| 49 |
-
# st.write('before', app_state)
|
| 50 |
-
|
| 51 |
-
titles = [a["title"] for a in self.apps]
|
| 52 |
-
functions = [a["function"] for a in self.apps]
|
| 53 |
-
default_radio = titles.index(app_state["page"]) if "page" in app_state else 0
|
| 54 |
-
|
| 55 |
-
st.sidebar.title("Navigation")
|
| 56 |
-
|
| 57 |
-
title = st.sidebar.radio("Go To", titles, index=default_radio, key="radio")
|
| 58 |
-
|
| 59 |
-
app_state["page"] = st.session_state.radio
|
| 60 |
-
# st.write('after', app_state)
|
| 61 |
-
|
| 62 |
-
st.experimental_set_query_params(**app_state)
|
| 63 |
-
# st.experimental_set_query_params(**st.session_state.to_dict())
|
| 64 |
-
functions[titles.index(title)]()
|
| 65 |
-
|
| 66 |
-
st.sidebar.title("Contribute")
|
| 67 |
-
st.sidebar.info(
|
| 68 |
-
"This is an open source project and you are very welcome to contribute your "
|
| 69 |
-
"comments, questions, resources and apps as "
|
| 70 |
-
"[issues](https://github.com/giswqs/streamlit-geospatial/issues) or "
|
| 71 |
-
"[pull requests](https://github.com/giswqs/streamlit-geospatial/pulls) "
|
| 72 |
-
"to the [source code](https://github.com/giswqs/streamlit-geospatial). "
|
| 73 |
-
)
|
| 74 |
-
st.sidebar.title("About")
|
| 75 |
-
st.sidebar.info(
|
| 76 |
-
"""
|
| 77 |
-
This web [app](https://share.streamlit.io/giswqs/streamlit-geospatial/app.py) is maintained by [Qiusheng Wu](https://wetlands.io). You can follow me on social media:
|
| 78 |
-
[GitHub](https://github.com/giswqs) | [Twitter](https://twitter.com/giswqs) | [YouTube](https://www.youtube.com/c/QiushengWu) | [LinkedIn](https://www.linkedin.com/in/qiushengwu).
|
| 79 |
-
This web app URL: <https://streamlit.gishub.org>
|
| 80 |
-
"""
|
| 81 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
postBuild
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
# enable nbserverproxy
|
| 2 |
-
jupyter serverextension enable --sys-prefix nbserverproxy
|
| 3 |
-
# streamlit launches at startup
|
| 4 |
-
mv streamlit_call.py ${NB_PYTHON_PREFIX}/lib/python*/site-packages/
|
| 5 |
-
# enable streamlit extension
|
| 6 |
-
jupyter serverextension enable --sys-prefix streamlit_call
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup.sh
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
# sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
|
| 2 |
-
# sudo apt-get update
|
| 3 |
-
# sudo apt-get install python3-dev
|
| 4 |
-
# sudo apt-get install gdal-bin
|
| 5 |
-
# sudo apt-get install libgdal-dev
|
| 6 |
-
# export CPLUS_INCLUDE_PATH=/usr/include/gdal
|
| 7 |
-
# export C_INCLUDE_PATH=/usr/include/gdal
|
| 8 |
-
# gdal-config --version
|
| 9 |
-
# pip install GDAL==$(gdal-config --version | awk -F'[.]' '{print $1"."$2}') localtileserver
|
| 10 |
-
|
| 11 |
-
mkdir -p ~/.streamlit/
|
| 12 |
-
echo "\
|
| 13 |
-
[server]\n\
|
| 14 |
-
headless = true\n\
|
| 15 |
-
port = $PORT\n\
|
| 16 |
-
enableCORS = false\n\
|
| 17 |
-
\n\
|
| 18 |
-
" > ~/.streamlit/config.toml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
streamlit_app.py
DELETED
|
@@ -1,43 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import leafmap.foliumap as leafmap
|
| 3 |
-
|
| 4 |
-
st.set_page_config(layout="wide")
|
| 5 |
-
|
| 6 |
-
st.sidebar.info(
|
| 7 |
-
"""
|
| 8 |
-
- Web App URL: <https://streamlit.gishub.org>
|
| 9 |
-
- GitHub repository: <https://github.com/giswqs/streamlit-geospatial>
|
| 10 |
-
"""
|
| 11 |
-
)
|
| 12 |
-
|
| 13 |
-
st.sidebar.title("Contact")
|
| 14 |
-
st.sidebar.info(
|
| 15 |
-
"""
|
| 16 |
-
Qiusheng Wu at [wetlands.io](https://wetlands.io) | [GitHub](https://github.com/giswqs) | [Twitter](https://twitter.com/giswqs) | [YouTube](https://www.youtube.com/c/QiushengWu) | [LinkedIn](https://www.linkedin.com/in/qiushengwu)
|
| 17 |
-
"""
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
# Customize page title
|
| 21 |
-
st.title("Streamlit for Geospatial Applications")
|
| 22 |
-
|
| 23 |
-
st.markdown(
|
| 24 |
-
"""
|
| 25 |
-
This multipage app template demonstrates various interactive web apps created using [streamlit](https://streamlit.io) and [leafmap](https://leafmap.org). It is an open-source project and you are very welcome to contribute to the [GitHub repository](https://github.com/giswqs/streamlit-multipage-template).
|
| 26 |
-
"""
|
| 27 |
-
)
|
| 28 |
-
|
| 29 |
-
st.header("Instructions")
|
| 30 |
-
|
| 31 |
-
markdown = """
|
| 32 |
-
1. For the [GitHub repository](https://github.com/giswqs/streamlit-multipage-template) or [use it as a template](https://github.com/giswqs/streamlit-multipage-template/generate) for your own project.
|
| 33 |
-
2. Customize the sidebar by changing the sidebar text and logo in each Python files.
|
| 34 |
-
3. Find your favorite emoji from https://emojipedia.org.
|
| 35 |
-
4. Add a new app to the `pages/` directory with an emoji in the file name, e.g., `1_🚀_Chart.py`.
|
| 36 |
-
|
| 37 |
-
"""
|
| 38 |
-
|
| 39 |
-
st.markdown(markdown)
|
| 40 |
-
|
| 41 |
-
m = leafmap.Map(minimap_control=True)
|
| 42 |
-
m.add_basemap("OpenTopoMap")
|
| 43 |
-
m.to_streamlit(height=500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
streamlit_call.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
from subprocess import Popen
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
def load_jupyter_server_extension(nbapp):
|
| 5 |
-
"""serve the streamlit app"""
|
| 6 |
-
Popen(
|
| 7 |
-
[
|
| 8 |
-
"streamlit",
|
| 9 |
-
"run",
|
| 10 |
-
"Home.py",
|
| 11 |
-
"--browser.serverAddress=0.0.0.0",
|
| 12 |
-
"--server.enableCORS=False",
|
| 13 |
-
]
|
| 14 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|