การเปลี่ยนระบบพิกัดอ้างอิง
ในแบบฝึกหัดนี้ จะได้เรียนรู้วิธีตรวจสอบระบบพิกัดอ้างอิงของ GeoDataFrame และวิธีเปลี่ยนระบบพิกัดนั้น โดยมี GeoDataFrame ของเขตการศึกษาพร้อมใช้งานในตัวแปร school_districts
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การแสดงผลข้อมูลเชิงภูมิศาสตร์ด้วย Python
คำแนะนำการฝึกหัด
- พิมพ์แถวแรกของ
school_districtsและ propertycrsของ GeoDataFrame นี้ - แปลงระบบพิกัดอ้างอิงของ
school_districtsเป็นepsg:3857 - พิมพ์ property
crsอีกครั้งเพื่อยืนยันว่าการเปลี่ยนแปลงสำเร็จแล้ว
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Print the first row of school districts GeoDataFrame and the crs
print(____.head(1))
print(____.crs)
# Convert the crs to epsg:3857
school_districts.geometry = school_districts.geometry.____(epsg = 3857)
# Print the first row of school districts GeoDataFrame and the crs again
print(school_districts.head(1))
print(____.____)