|
import streamlit as st |
|
import ibis |
|
from ibis import _ |
|
con = ibis.duckdb.connect() |
|
|
|
st.title("Exploring Redlining in the USA") |
|
|
|
option = st.selectbox( |
|
"Pick a city:", |
|
("Oakland", "San Francisco", "Chicago"), |
|
index = 1, |
|
placeholder = "Select a city", |
|
) |
|
|
|
redlines = con.read_geo("/vsicurl/https://dsl.richmond.edu/panorama/redlining/static/mappinginequality.gpkg") |
|
|
|
city = redlines.filter(_.city == option) |
|
|
|
city_gdf = city.execute() |
|
|
|
st.write("You selected:", option) |
|
|
|
import leafmap.maplibregl as leafmap |
|
m = leafmap.Map(style = "voyager") |
|
m.add_gdf(city_gdf) |
|
m.add_gdf(city_gdf, "fill", paint = { "fill-color": ["get", "fill"], "fill-opacity": 0.8}) |
|
m.to_streamlit() |