Créer une localisation folium à partir du centroïde urbain
Pour construire une carte folium du quartier Urban Residents, vous devez créer une paire de coordonnées au format attendu par folium.
Cet exercice fait partie du cours
Visualiser des données géospatiales en Python
Instructions
- Affichez le head de
urban_polygon. - Stockez la première occurrence de
centersous le nomurban_centeret affichezurban_center. Ceci a été fait pour vous. - Créez un tableau à partir de urban_center qui inverse l’ordre de la longitude et de la latitude. Appelez-le
urban_location. - Affichez
urban_location. Ceci a été fait pour vous.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Print the head of the urban_polygon
print(urban_polygon.____())
# Create urban_center from the urban_polygon center
urban_center = ____.____[0]
# Print urban_center
print(urban_center)
# Create array for folium called urban_location
urban_location = [urban_center.____, urban_center.____]
# Print urban_location
print(urban_location)