python - can't locate shapefile in basemap Python
问题描述
I put a shapefile "china.shp" in my working directory, I tried many ways to set the path to file for basemap to read it, like
m3= Basemap(llcrnrlon=77, llcrnrlat=14, urcrnrlon=140, urcrnrlat=51, projection='lcc', lat_1=33, lat_2=45, lon_0=100)
m3.readshapefile("Y:/Study/Research_Data/geoschem/china", 'china', drawbounds=True)
plt.show()
But the error is always cannot locate Y:/Study/Research_Data/geoschem/china.shx
Do you have any idea how to set the path, please? Thanks.
解决方案
shapefile 通常带有辅助文件,例如“.shx”、“.dbf”、“.prj”。这里需要“.shx”来加载相应的 shapefile。如果您移动了 shapefile,则应该将其辅助文件移动到相同的位置。
推荐阅读
- tensorflow - 如何在 TensorFlow 2.0 中调试 Keras?
- python - python列表循环中的前一个元素
- firebird - Firebird 错误:尝试更新只读数据库
- node.js - node-quickbooks Express Sessions oAuth
- python - 如何使用谷歌 API 每天从 youtube 上抓取 10k 条记录
- javascript - 无法使用节点 js process.kill(pid) 杀死 linux 进程
- macos - kext开发macOS的等待和信号机制
- javascript - 在再次调用之前销毁 javascript 中的函数
- r - 创建子目录并存储文件
- python - 在矩阵 M (m,k) 中找到向量 v (1,k) 的出现