CommencerCommencer gratuitement

Folium street map of the downtown neighborhood

This time you will create the folium map of downtown and add the Urban Residents neighborhood area from urban_polygon. The urban_polygon has been printed to your console.

Cet exercice fait partie du cours

Visualizing Geospatial Data in Python

Afficher le cours

Instructions

  • Create an array called folium_loc from urban_polygon.center
  • Create a folium map called downtown_map. Set the location argument equal to folium_loc and initialize the map with a zoom_start of 15.
  • Pass the geometry from the urban_polygon GeoDataFrame to the folium.GeoJson() method. Then call add_to() on that.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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)
Modifier et exécuter le code