cartopy.io.shapereader.NEShpDownloader#
- class cartopy.io.shapereader.NEShpDownloader(url_template='https://naturalearth.s3.amazonaws.com/{resolution}_{category}/ne_{resolution}_{name}.zip', target_path_template=None, pre_downloaded_path_template='')[source]#
Specialise
cartopy.io.Downloader
to download the zipped Natural Earth shapefiles and extract them to the defined location (typically user configurable).The keys which should be passed through when using the
format_dict
are typicallycategory
,resolution
andname
.- __init__(url_template='https://naturalearth.s3.amazonaws.com/{resolution}_{category}/ne_{resolution}_{name}.zip', target_path_template=None, pre_downloaded_path_template='')[source]#
Methods
__init__
([url_template, ...])acquire_resource
(target_path, format_dict)Download the zip file and extracts the files listed in
zip_file_contents()
to the target path.default_downloader
()Return a generic, standard, NEShpDownloader instance.
from_config
(specification[, config_dict])The
from_config
static method implements the logic for acquiring a Downloader (sub)class instance from the config dictionary.path
(format_dict)Returns the path to a file on disk that this resource represents.
pre_downloaded_path
(format_dict)The path on disk of the file that this resource represents, if it does not exist, then no further action will be taken with this path, and all further processing will be done using
target_path()
instead.target_path
(format_dict)The path on disk of the file that this resource represents, must either exist, or be writable by the current user.
url
(format_dict)The full URL that this resource represents.
zip_file_contents
(format_dict)Return a generator of the filenames to be found in the downloaded natural earth zip file.
Attributes
FORMAT_KEYS
The minimum keys which should be provided in the
format_dict
argument for thepath
,url
,target_path
,pre_downloaded_path
andacquire_resource
methods.