หาพื้นที่ของย่าน Urban Residents
ย่าน Urban Residents มีพื้นที่ขนาดเท่าใด?
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การแสดงผลข้อมูลเชิงภูมิศาสตร์ด้วย Python
คำแนะนำการฝึกหัด
- แสดงผล urban polygon และสังเกตหน่วยของแต่ละคู่ลองจิจูด/ละติจูด
- สร้าง
urban_poly_3857โดยเรียกto_crs()บนurban_polygonแล้วแสดงผล head อีกครั้ง สังเกตว่าหน่วยของแต่ละคู่ลองจิจูด/ละติจูดเปลี่ยนไป - แสดงผลพื้นที่ของ
urban_poly_3857อย่าลืมหารด้วย10**6เพื่อแปลงหน่วยเป็นตารางกิโลเมตร
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Print the head of the urban polygon
print(urban_polygon.____())
# Create a copy of the urban_polygon using EPSG:3857 and print the head
urban_poly_3857 = urban_polygon.____(epsg = ____)
print(urban_poly_3857.head())
# Print the area of urban_poly_3857 in kilometers squared
area = urban_poly_3857.____ / ____
print('The area of the Urban Residents neighborhood is ', area[0], ' km squared')