Location of stored offline data for cartopy

前端 未结 1 598
闹比i
闹比i 2020-12-16 19:15

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

相关标签:
1条回答
  • 2020-12-16 19:31

    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
    
    0 讨论(0)
提交回复
热议问题