【问题标题】:Use Cartopy Maps Offline离线使用 Cartopy 地图
【发布时间】:2019-03-12 04:53:14
【问题描述】:

我正在尝试使用 Cartopy 离线绘制地图。我找到了这篇文章: Location of stored offline data for cartopy 但是,将下载文件所在的cartopy.config['data_dir']更改为'C:/...'后,当我尝试绘制海岸线时,它仍然想下载地图。

cartopy.config['data_dir'] = '.../CartopyMaps'
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()

控制台说:

Downloading: 
http://naciscdn.org/naturalearth/110m/physical/ne_110m_coastline.zip

但是,我在.../CartopyMaps/shapefiles/natural_earth/physical/ 中有ne_110m_coastline dbf、shp 和 shx 文件

为什么 Cartopy 看不到我的本地地图,我该如何解决?

【问题讨论】:

  • 有没有人解决这个问题?我有同样的问题。 Cartopy 坚持下载地图,即使我在规定的 data_dir 中有地图

标签: offline cartopy


【解决方案1】:

尝试使用“pre_existing_data_dir”路径而不是“data_dir”。

from os.path import expanduser
import cartopy
cartopy.config['pre_existing_data_dir'] = expanduser('~/cartopy-data/')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-22
    • 2018-01-02
    • 2016-12-21
    • 1970-01-01
    相关资源
    最近更新 更多