cartopy 存储的离线数据的位置 [英] Location of stored offline data for cartopy

查看:39
本文介绍了cartopy 存储的离线数据的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cartopy 中的离线数据存储在哪里?它是否存储在站点包下的数据文件夹中?有没有办法触发所有可用数据的下载?我想将其复制到未连接到互联网的 Linux 机器上.我目前正在连接到互联网的 Windows 机器上工作,所以我希望从那里下载数据.谢谢.

解决方案

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

<预><代码>>>>导入 cartopy.config>>>cartopy.config['data_dir']'/home/pelson/.local/share/cartopy'

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

最后,要批量下载所有数据(几GB),在 tools/feature_download.py.运行它来下载所有数据很简单:

$>python工具/feature_download.py

提供全面帮助:

$>python 工具/feature_download.py --help用法:feature_download.py [-h] [--output OUTPUT] [--dry-run] [--ignore-repo-data] GROUP_NAME [GROUP_NAME ...]下载要素数据集.位置参数:GROUP_NAME 功能组名称:culture-extra、culture、gshhs、physical可选参数:-h, --help 显示此帮助信息并退出--输出输出,-o输出将数据集保存在指定目录中(默认:用户缓存目录)--dry-run 只打印要下载的 URL--ignore-repo-data 下载时忽略现有的 repo 数据

Where is offline data stored in cartopy? Is it stored in the data folder under site-packages? Is there any way to trigger the downloading of all available data? I would like to copy this over to a Linux machine that is not connected to the internet. I'm currently working from a Windows machine that is connected to the internet, so I'm hoping to download the data from there. Thanks.

解决方案

Take a look at the config docs in http://scitools.org.uk/cartopy/docs/latest/cartopy.html. Essentially, the data is downloaded to the data_dir item in that config. For me that looks like:

>>> import cartopy.config        
>>> cartopy.config['data_dir']
'/home/pelson/.local/share/cartopy'

Of course, that can be configured to wherever you like. Because I also deploy cartopy to my organisation, we also configure cartopy to have centrally stored data. This is put in a location determined by the pre_existing_data_dir config item.

Finally, to batch download all of the data (which is several GB), there is a script in the cartopy source at tools/feature_download.py. Running it to download all of the data is simply:

$> python tools/feature_download.py

Full help is available:

$> 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

这篇关于cartopy 存储的离线数据的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆