Location of stored offline data for cartopy

社会主义新天地 提交于 2019-11-29 04:28:35

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!