市中心社區的 Folium 街道地圖
這次你要建立市中心的 folium 地圖,並把 urban_polygon 中的 Urban Residents 社區範圍加入地圖。urban_polygon 已經印在你的主控台上。
本練習屬於課程
在 Python 視覺化地理空間資料
練習說明
- 從
urban_polygon.center建立一個名為folium_loc的陣列。 - 建立一個名為
downtown_map的 folium 地圖。將 location 參數設為folium_loc,並以 zoom_start 為 15 初始化地圖。 - 將
urban_polygonGeoDataFrame 的 geometry 傳入folium.GeoJson()方法。接著對它呼叫add_to()。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Create array for called folium_loc from the urban_polygon center point
point = urban_polygon.____[0]
folium_loc = [point.____, point.____]
# Construct a map from folium_loc: downtown_map
downtown_map = folium.Map(location = ____, ____ = 15)
# Draw our neighborhood: Urban Residents
folium.GeoJson(____.____).add_to(____)
# Display the map
display(downtown_map)