开始使用免费开始使用

更改坐标参考系

在本练习中,您将学习如何查看 GeoDataFrame 的坐标参考系,以及如何进行转换。学区(school districts)的 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(____.____)
编辑并运行代码