Urban Residents पड़ोस का केंद्र
अब आप urban_poly_3857 का केंद्र बिंदु निकालेंगे और उसे पॉलीगॉन के ऊपर प्लॉट करेंगे.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Geospatial Data का Visualization
अभ्यास निर्देश
- GeoSeries के
centroidएट्रिब्यूट का उपयोग करकेurban_poly_3857सेdowntown_centerबनाएँ. downtown_centerका datatype प्रिंट करें.urban_poly_3857कोaxके रूप मेंlightgreenरंग के साथ प्लॉट करें.downtown_centerको प्लॉट करें, औरax = axतथाcolor = blackसेट करें. x-axis के ticks आपके लिए rotate किए गए हैं. प्लॉट दिखाने के लिए कोड दिया हुआ है.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# 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()