python geopandas包加载shp文件
我参考geopandas 包里的用法http://geopandas.org/mapping.html,但就是加载不出shp文件,我的代码:
# -*- coding: utf-8 -*-
import geopandas as gpd
world=gpd.read_file(gpd.datasets.get_path('D:\clip\clip\studyarea.shp'))
world.head()
world.plot()
报错The dataset 'D:\clip\clip\studyarea.shp' is not available
还有另外一个加载办法,没报错但是也没有显示窗体、图像,代码如下
import geopandas as gp
china_geod =gp.GeoDataFrame.from_file('D:\clip\clip\studyarea.shp',encoding = 'gb18030')
china_geod.head()
china_geod.plot(color='white',figsize=(100, 100))
结果是 Process finished with exit code 0