- 积分
- 1890
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-2-27
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 sam_doggy 于 2021-8-14 19:28 编辑
cartopy在读取shapefile的时候不能默认加载其中的.prj文件,也就是说无法自动获取其投影,我现在想到的做法是用geopandas读取后转换投影,不知道有没有方法不依赖geopandas库读取呢(应该暴力破解正则匹配prj文件内容也行,但是我不太了解.prj文件的格式,也不想重复造轮子)- import geopandas as gpd
- shdf = gpd.read_file(filename)
- shdf = shdf.to_crs("EPSG:4326")
- shape_feature = cfeature.ShapelyFeature(shdf.geometry, ccrs.LambertConformal(), edgecolor='r', facecolor='none')
- ax.add_feature(shape_feature)
复制代码
|
|