存储的离线数据的位置

Dan*_*all 8 python python-2.7 cartopy

离线数据存储在纸板中的哪个位置?它是存储在site-packages下的数据文件夹中吗?有没有办法触发下载所有可用数据?我想将其复制到未连接到互联网的Linux机器上.我目前正在使用连接到互联网的Windows机器,所以我希望从那里下载数据.谢谢.

pel*_*son 13

请查看http://scitools.org.uk/cartopy/docs/latest/cartopy.html中的配置文档.实质上,数据被下载到该data_dir配置中的项目.对我来说,看起来像:

>>> import cartopy.config        
>>> cartopy.config['data_dir']
'/home/pelson/.local/share/cartopy'
Run Code Online (Sandbox Code Playgroud)

当然,这可以配置到任何你喜欢的地方.因为我还将cartopy部署到我的组织,所以我们还配置了cartopy以集中存储数据.这放在由pre_existing_data_dir配置项确定的位置.

最后,要批量下载所有数据(几GB),在tool/feature_download.py的cartopy源中有一个脚本.运行它来下载所有数据简单地说:

$> python tools/feature_download.py
Run Code Online (Sandbox Code Playgroud)

提供全面帮助:

$> python tools/feature_download.py --help
usage: feature_download.py [-h] [--output OUTPUT] [--dry-run] [--ignore-repo-data] GROUP_NAME [GROUP_NAME ...]

Download feature datasets.

positional arguments:
  GROUP_NAME            Feature group name: cultural-extra, cultural, gshhs, physical

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        save datasets in the specified directory (default: user cache directory)
  --dry-run             just print the URLs to download
  --ignore-repo-data    ignore existing repo data when downloading
Run Code Online (Sandbox Code Playgroud)