无法在底图Python中找到shapefile

问题描述 投票:0回答:1

我在工作目录中放置了一个shapefile“ china.shp”,我尝试了多种方法来设置要读取底图的文件路径,例如

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()

但是错误始终是cannot locate Y:/Study/Research_Data/geoschem/china.shx

您知道如何设置路径吗?谢谢。

python python-3.x matplotlib-basemap
1个回答
0
投票

shapefile通常随附辅助文件,例如“ .shx”,“。dbf”,“。prj”。为了加载相应的shapefile,此处需要“ .shx”。如果移动了shapefile,则应将其辅助文件移动到相同的位置。

© www.soinside.com 2019 - 2024. All rights reserved.