离线数据在cartopy中存储在哪里?它存储在site-packages下的data文件夹中吗?是否有任何方法触发下载所有可用数据?我想将其复制到未连接到互联网的Linux机器上。我目前正在连接到互联网的Windows机器上工作,因此希望从那里下载数据。谢谢。
离线数据在cartopy中存储在哪里?它存储在site-packages下的data文件夹中吗?是否有任何方法触发下载所有可用数据?我想将其复制到未连接到互联网的Linux机器上。我目前正在连接到互联网的Windows机器上工作,因此希望从那里下载数据。谢谢。
请查看http://scitools.org.uk/cartopy/docs/latest/cartopy.html中的配置文档。基本上,数据被下载到该配置中的data_dir
项。对我来说,看起来像:
>>> import cartopy.config
>>> cartopy.config['data_dir']
'/home/pelson/.local/share/cartopy'
当然,可以将其配置到任何您喜欢的位置。
因为我也将cartopy部署到了我的组织中,我们还配置了cartopy以拥有集中存储的数据。 这是通过pre_existing_data_dir
配置项确定的位置。
最后,要批量下载所有数据(总共几GB),在cartopy源代码中有一个脚本位于tools/feature_download.py。运行它来下载所有数据只需要:$> python tools/feature_download.py
完整的帮助文档已经提供:
$> 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
feature_download.py
文件已更名为cartopy_feature_download.py
,应将其添加到路径中,因此现在您可以从命令行直接调用它:cartopy_feature_download.py
。 - Dan