Urban Residents mahallesinin merkezi
Şimdi urban_poly_3857 öğesinin merkez noktasını bulup çokgenin üzerine çizeceksin.
Bu egzersiz, kursun bir parçasıdır
Python ile Coğrafi Verileri Görselleştirme
Egzersiz talimatları
- GeoSeries
centroidözniteliğini kullanarakurban_poly_3857'dendowntown_centeroluştur. downtown_center'ın veri tipini yazdır.urban_poly_3857'ilightgreenrengiyle ax olarak çiz.downtown_center'ıax = axvecolor = blackayarlarıyla çiz. x ekseni işaretleri senin için döndürüldü. Grafiği göstermek için gerekli kodu ekledik.
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
# 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()