File size: 726 Bytes
14d83f7
 
 
 
 
 
 
 
 
54b9841
8e169eb
54b9841
 
8e169eb
54b9841
 
8e169eb
 
54b9841
8e169eb
 
 
 
 
 
54b9841
8e169eb
 
 
 
54b9841
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
28
29
30
31
32
import streamlit as st

st.set_page_config(
    page_title="Streamlit demos",
)

st.sidebar.success("Select a demo above.")


import streamlit as st
import leafmap.maplibregl as leafmap
import ibis
from ibis import _
con = ibis.duckdb.connect()


# fixme could create drop-down selection of the 300 cities
city_name = st.text_input("Select a city", "New Haven")

# Extract the specified city 
city = (con
    .read_geo("/vsicurl/https://dsl.richmond.edu/panorama/redlining/static/mappinginequality.gpkg")
    .filter(_.city == city_name, _.residential)
    .execute()
)

# Render the map
m = leafmap.Map(style="positron")
m.add_gdf(city, "fill", paint = {"fill-color": ["get", "fill"], "fill-opacity": 0.8})
m.to_streamlit()