对 GeoDataFrame 进行投影
巴黎区划数据集采用地理坐标(WGS84 下的经度/纬度)。为了解在绘图或计算时直接按原样使用这些数据会出现什么问题,我们将先按原样绘制一次,然后再绘制一个投影后的版本。
法国的标准投影坐标参考系统是 RGF93 / Lambert-93(对应编号为 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()