變更座標參考系統
在這個練習中,你會學到如何查詢 GeoDataFrame 的座標參考系統,以及如何變更它。學區的 GeoDataFrame 已載入為 school_districts。
本練習屬於課程
在 Python 視覺化地理空間資料
練習說明
- 列印
school_districts的第一列,以及此 GeoDataFrame 的crs屬性。 - 將
school_districts的座標參考系統轉換為epsg:3857。 - 再次列印
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(____.____)