Created
September 16, 2021 13:28
-
-
Save janbenetka/6462c2f484ce147e35ba2c4dc15228f2 to your computer and use it in GitHub Desktop.
[Site Selection - CBGs] #mango #bigquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unique_venues = sites_with_foot_traffic.drop_duplicates(subset=['name']) | |
# initialize map | |
map = folium.Map(location = [30.3006387,-97.7587983], | |
zoom_start = 11, | |
tiles='Stamen Toner') | |
# add pins of candidate locations | |
for _, r in unique_venues.iterrows(): | |
geo_j = gpd.GeoSeries(r['geo']).to_json() | |
geo_j = folium.GeoJson(data=geo_j, style_function=lambda x: {'fillColor': 'red'}) | |
folium.Popup(r['us_cbgs_2018_name']).add_to(geo_j) | |
geo_j.add_to(map) | |
map.add_child(folium.Marker(location = [r.latitude, r.longitude], popup = str(r["name"]), icon = folium.Icon(color = "red"))) | |
# show the map | |
map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment