Spaces:
Running
Running
docker-based
Browse files- Dockerfile +11 -0
- README.md +4 -7
- app.py +14 -13
- requirements.txt +1 -11
Dockerfile
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM gitlab-registry.nrp-nautilus.io/cboettig/images
|
2 |
+
WORKDIR /app
|
3 |
+
|
4 |
+
COPY . .
|
5 |
+
|
6 |
+
# huggingface uses port 7860 by default
|
7 |
+
CMD streamlit run app.py \
|
8 |
+
--server.address 0.0.0.0 \
|
9 |
+
--server.port 7860 \
|
10 |
+
--server.headless true \
|
11 |
+
--server.fileWatcherType none
|
README.md
CHANGED
@@ -1,14 +1,11 @@
|
|
1 |
---
|
2 |
title: Streamlit Demo
|
3 |
emoji: π
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
-
sdk:
|
7 |
-
sdk_version: 1.40.1
|
8 |
-
app_file: app.py
|
9 |
pinned: false
|
10 |
license: bsd-2-clause
|
11 |
-
short_description: demonstration of streamlit for espm-157
|
12 |
---
|
13 |
|
14 |
-
|
|
|
1 |
---
|
2 |
title: Streamlit Demo
|
3 |
emoji: π
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: indigo
|
6 |
+
sdk: docker
|
|
|
|
|
7 |
pinned: false
|
8 |
license: bsd-2-clause
|
|
|
9 |
---
|
10 |
|
11 |
+
|
app.py
CHANGED
@@ -1,21 +1,22 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
import ibis
|
3 |
from ibis import _
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
st.title("_Streamlit_ is :blue[cool] :sunglasses:")
|
8 |
-
|
9 |
-
city_name = st.text_input("Which City?", "Oakland")
|
10 |
|
11 |
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
16 |
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
m = leafmap.Map()
|
19 |
-
m.add_cog_layer("https://espm-157-f24.github.io/spatial-carl-amanda-tyler/ndvi.tif", palette = "greens")
|
20 |
-
m.add_gdf(city)
|
21 |
-
m.to_streamlit()
|
|
|
1 |
import streamlit as st
|
2 |
+
import leafmap.maplibregl as leafmap
|
3 |
import ibis
|
4 |
from ibis import _
|
5 |
+
con = ibis.duckdb.connect()
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
|
8 |
+
# fixme could create drop-down selection of the 300 cities
|
9 |
+
city_name = st.text_input("Select a city", "New Haven")
|
10 |
|
11 |
+
# Extract the specified city
|
12 |
+
city = (con
|
13 |
+
.read_geo("/vsicurl/https://dsl.richmond.edu/panorama/redlining/static/mappinginequality.gpkg")
|
14 |
+
.filter(_.city == city_name, _.residential)
|
15 |
+
.execute()
|
16 |
+
)
|
17 |
|
18 |
+
# Render the map
|
19 |
+
m = leafmap.Map(style="positron")
|
20 |
+
m.add_gdf(city, "fill", paint = {"fill-color": ["get", "fill"], "fill-opacity": 0.8})
|
21 |
+
m.to_streamlit()
|
22 |
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
@@ -1,11 +1 @@
|
|
1 |
-
|
2 |
-
seaborn
|
3 |
-
ibis-framework[duckdb]
|
4 |
-
nbval
|
5 |
-
leafmap[maplibre]
|
6 |
-
geopandas
|
7 |
-
pystac-client
|
8 |
-
odc-stac
|
9 |
-
rioxarray
|
10 |
-
exactextract
|
11 |
-
git+https://github.com/eodaGmbH/py-maplibregl@feature/color-utils
|
|
|
1 |
+
streamlit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|