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 3
3
# Released under the BSD License
4
4
# -----------------------------------------------------------------------------
5
5
import numpy as np
6
- import cartopy . crs
6
+ import cartopy
7
7
import matplotlib as mpl
8
8
import matplotlib .pyplot as plt
9
9
10
10
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
+
11
22
# Polar plot
12
23
# -----------------------------------------------------------------------------
13
24
mpl .rc ('axes' , linewidth = 4.0 )
You can’t perform that action at this time.
0 commit comments