Spaces:
Sleeping
Sleeping
import streamlit as st | |
import leafmap.foliumap as leafmap | |
import webbrowser | |
webbrowser.open("http://streamlit.io") # opens the URL in a new tab | |
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("Interactive Crime Map Application") | |
st.markdown( | |
""" | |
This interactive crime map apps created using [streamlit](https://streamlit.io) and open-source mapping libraries, | |
such as [leafmap](https://leafmap.org), [geemap](https://geemap.org), [pydeck](https://deckgl.readthedocs.io), and [kepler.gl](https://docs.kepler.gl/docs/keplergl-jupyter). | |
""" | |
) | |
st.info("Click on the left sidebar menu to navigate to the different apps.") | |
st.subheader("Interactive Crime Map Application") | |
st.markdown( | |
""" | |
""" | |
) | |
m = leafmap.Map(center=[51.50, -0.1], zoom=10) | |
tweets = 'https://raw.githubusercontent.com/yunusserhat/Github/main/data/London2022DecHateTweetsLatLong.csv' | |
borough = 'https://raw.githubusercontent.com/yunusserhat/Github/main/data/londonborough.geojson' | |
m.add_geojson(borough, layer_name='London Boroughs') | |
m.add_points_from_xy( | |
tweets, | |
x="Longitude", | |
y="Latitude" | |
# , | |
# color_column='hate_pred', | |
# icon_names=['gear', 'map', 'leaf', 'globe'], | |
# spin=True, | |
# add_legend=True, | |
) | |
m.to_streamlit(height=700) | |