เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

สร้าง folium location จาก urban centroid

ในการสร้างแผนที่ folium ของย่าน Urban Residents ต้องสร้างคู่พิกัดในรูปแบบที่ folium รองรับก่อน

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

การแสดงผลข้อมูลเชิงภูมิศาสตร์ด้วย Python

ดูคอร์ส

คำแนะนำการฝึกหัด

  • แสดงค่า head ของ urban_polygon
  • เก็บค่าแรกของ center ไว้ในตัวแปร urban_center แล้วแสดงผล urban_center (ดำเนินการให้แล้ว)
  • สร้าง array จาก urban_center โดยสลับลำดับของลองจิจูดและละติจูด แล้วตั้งชื่อว่า urban_location
  • แสดงผล urban_location (ดำเนินการให้แล้ว)

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# 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)
แก้ไขและรันโค้ด