File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 33# Released under the BSD License
44# -----------------------------------------------------------------------------
55import numpy as np
6- import cartopy . crs
6+ import cartopy
77import matplotlib as mpl
88import matplotlib .pyplot as plt
99
1010
11+ CARTOPY_SOURCE_TEMPLATE = 'https://naturalearth.s3.amazonaws.com/{resolution}_{category}/ne_{resolution}_{name}.zip'
12+
13+
14+ # Configures cartopy to download NaturalEarth shapefiles from S3 instead of naciscdn
15+ # Taken from https://github.com/SciTools/cartopy/issues/1325#issuecomment-904343657
16+ target_path_template = cartopy .io .shapereader .NEShpDownloader .default_downloader ().target_path_template
17+ downloader = cartopy .io .shapereader .NEShpDownloader (url_template = CARTOPY_SOURCE_TEMPLATE ,
18+ target_path_template = target_path_template )
19+ cartopy .config ['downloaders' ][('shapefiles' , 'natural_earth' )] = downloader
20+
21+
1122# Polar plot
1223# -----------------------------------------------------------------------------
1324mpl .rc ('axes' , linewidth = 4.0 )
You can’t perform that action at this time.
0 commit comments