Spaces:
Sleeping
Sleeping
testing
Browse files
app.py
CHANGED
@@ -1,3 +1,22 @@
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
st.title("Testing!")
|
|
|
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 |
|
|