File size: 793 Bytes
8d4841f 4971246 8d4841f c5fca7e 8d4841f c5fca7e 8d4841f c5fca7e 8d4841f c5fca7e 8d4841f c5fca7e 8d4841f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st #import streamlit to build an app
import ibis #import ibis to run python package
from ibis import _
con = ibis.duckdb.connect()
st.title("Exploring Redlining in the USA") #website title
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() # convert city into a gdf
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() |