Spaces:
Sleeping
Sleeping
File size: 2,792 Bytes
6c0b6f0 16ee35c 6c0b6f0 e21d3ea 16ee35c 6c0b6f0 16ee35c 6c0b6f0 16ee35c 6c0b6f0 16ee35c 6c0b6f0 16ee35c b368c48 16ee35c 6c0b6f0 16ee35c 6c0b6f0 e99769f 16ee35c e99769f 16ee35c 6c0b6f0 16ee35c 6c0b6f0 e99769f 16ee35c |
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
import streamlit as st
import leafmap.foliumap as leafmap
import leafmap.colormaps as cm
st.set_page_config(layout="wide")
st.sidebar.info(
"""
- Web App URL: <https://interactive-crime-map.hf.space/>
- HuggingFace repository: <https://huggingface.co/spaces/interactive-crime/map/tree/main>
"""
)
st.sidebar.title("Contact")
st.sidebar.info(
"""
Yunus Serhat Bıçakçı at [yunusserhat.com](https://yunusserhat.com) | [GitHub](https://github.com/yunusserhat) | [Twitter](https://twitter.com/yunusserhat) | [LinkedIn](https://www.linkedin.com/in/yunusserhat)
"""
)
st.title("Comparision of Hate Tweets, Hate Crime Rates and Total Crime Rates")
st.markdown(
"""
These interactive maps illustrate a comparison of overall borough-level rates based on Twitter and London Metropolitan Police Service (MPS) data as of December 2022.
In the first map shows the representation of hate tweets according to Twitter data, while the second and third maps shows the representation of rates of hate and all crimes according to MPS data.
"""
)
row1_col1, row1_col2, row1_col3 = st.columns([1, 1, 1])
# Twitter Hate Tweets Map
with row1_col1:
twitter = "https://raw.githubusercontent.com/yunusserhat/data/main/data/boroughs_count_df_2022_dec.geojson"
m1 = leafmap.Map(center=[51.50, -0.1], zoom=10)
m1.add_data(
twitter,
column="count",
scheme='Quantiles',
cmap='YlOrRd',
legend_title='Total Hate Tweet Number'
)
# MPS Hate Crimes Map
with row1_col2:
mps_hate = "https://raw.githubusercontent.com/yunusserhat/data/main/data/mps_hate_2022_dec_count.geojson"
m2 = leafmap.Map(center=[51.50, -0.1], zoom=10)
m2.add_data(
mps_hate,
column="Hate_Crime_Number",
scheme='Quantiles',
cmap='YlOrRd',
legend_title='Hate Crime Number'
)
# MPS Total Crimes Map
with row1_col3:
mps_total = "https://raw.githubusercontent.com/yunusserhat/data/main/data/mps2022dec_count.geojson"
m3 = leafmap.Map(center=[51.50, -0.1], zoom=10)
m3.add_data(
mps_total,
column="Crime_Number",
scheme='Quantiles',
cmap='YlOrRd',
legend_title='Total Crime Number'
)
row2_col1, row2_col2, row2_col3 = st.columns([1, 1, 1])
# Setting the zoom and center for each map
longitude = -0.1
latitude = 51.50
zoomlevel = st.number_input("Zoom", 0, 20, 10)
with row2_col1:
m1.set_center(longitude, latitude, zoomlevel)
with row2_col2:
m2.set_center(longitude, latitude, zoomlevel)
with row2_col3:
m3.set_center(longitude, latitude, zoomlevel)
row3_col1, row3_col2, row3_col3 = st.columns([1, 1, 1])
with row3_col1:
m1.to_streamlit()
with row3_col2:
m2.to_streamlit()
with row3_col3:
m3.to_streamlit() |