投影 GeoDataFrame
巴黎行政區的資料集以地理座標提供(WGS84 的經度/緯度)。為了觀察在繪圖或計算時直接使用此資料會產生的問題,我們先以原始狀態繪圖,再繪製一個投影後的版本。
法國的標準投影 CRS 是 RGF93/Lambert-93 參考系統(其 EPSG 編號為 EPSG:2154)。
GeoPandas 和 matplotlib 已經匯入,並且行政區資料集已讀入並指派給變數 districts。
本練習屬於課程
在 Python 中處理地理空間資料
練習說明
- 列印
districts資料集的 CRS。 - 繪製
districts資料集的簡單圖。 - 將
districts轉換為投影座標系(使用法國的EPSG:2154)。將新的資料集命名為districts_RGF93。 - 以相同方式繪製
districts_RGF93。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Print the CRS information
print(____)
# Plot the districts dataset
____
plt.show()
# Convert the districts to the RGF93 reference system
districts_RGF93 = districts.____
# Plot the districts dataset again
districts_RGF93.____
plt.show()