El centro del barrio Urban Residents
Ahora vas a encontrar el punto central de urban_poly_3857 y a dibujarlo sobre el polígono.
Este ejercicio forma parte del curso
Visualización de datos geoespaciales en Python
Instrucciones del ejercicio
- Crea
downtown_centera partir deurban_poly_3857usando el atributocentroidde GeoSeries. - Imprime el tipo de dato de
downtown_center. - Dibuja
urban_poly_3857como ax usandolightgreencomo color. - Dibuja
downtown_center, estableciendoax = axycolor = black. Las marcas del eje x ya están giradas por ti. Hemos incluido el código para mostrar la gráfica.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Create downtown_center from urban_poly_3857
downtown_center = urban_poly_3857.____.____
# Print the type of downtown_center
print(type(downtown_center))
# Plot the urban_poly_3857 as ax and add the center point
ax = ____.plot(color = 'lightgreen')
____.plot(ax = ____, color = 'black')
plt.xticks(rotation = 45)
# Show the plot
plt.show()