|
import altair as alt |
|
import numpy as np |
|
import pandas as pd |
|
import streamlit as st |
|
|
|
""" |
|
# Welcome to Streamlit! |
|
|
|
Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:. |
|
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community |
|
forums](https://discuss.streamlit.io). |
|
|
|
In the meantime, below is an example of what you can do with just a few lines of code: |
|
""" |
|
|
|
import streamlit as st |
|
from streamlit_folium import st_folium |
|
from folium.plugins import Draw |
|
import folium |
|
|
|
m = folium.Map(location=[40.7128, -74.0060], zoom_start=12) |
|
Draw(export=True).add_to(m) |
|
output = st_folium(m, width=700, height=500) |
|
|
|
import pandas as pd |
|
|
|
|
|
df = pd.read_parquet("hf://datasets/ProjectMultiplexCoop/PropertyBoundaries/Property_Boundaries_4326.parquet") |
|
|
|
color_map = { |
|
"RESERVE": "#00FF00", |
|
"COMMON": "#FF0000", |
|
"CORRIDOR": "#0000FF", |
|
} |
|
|
|
import folium |
|
|
|
m = folium.Map(location=[43.6534817, -79.3839347], zoom_start=12) |
|
|
|
def style_function(feature): |
|
return { |
|
'fillColor': color_map.get(feature['properties']['type'], "#888888"), |
|
'color': color_map.get(feature['properties']['type'], "#888888"), |
|
'weight': 2, |
|
'fillOpacity': 0.5 |
|
} |
|
|
|
|
|
geojson = {"type": "FeatureCollection", "features": features} |
|
folium.GeoJson( |
|
geojson, |
|
style_function=style_function |
|
).add_to(m) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|