Skip to content

Commit 18dbf75

Browse files
authored
build: fix NaturalEarth url for cartopy (backport #240) (#250)
This is an automatic backport of pull request #240 done by [Mergify](https://mergify.io). --- <details> <summary>Mergify commands and options</summary> <br /> More conditions and actions can be found in the [documentation](https://docs.mergify.io/). You can also trigger Mergify actions by commenting on this pull request: - `@Mergifyio refresh` will re-evaluate the rules - `@Mergifyio rebase` will rebase this PR on its base branch - `@Mergifyio update` will merge the base branch into this PR - `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch Additionally, on Mergify [dashboard](https://dashboard.mergify.io/) you can: - look at your merge queues - generate the Mergify configuration with the config editor. Finally, you can contact us on https://mergify.io/ </details>
1 parent e49c581 commit 18dbf75

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include ../../../adm/root.mk
2+
include $(MFEXT_HOME)/share/layer_wrapper.mk
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include ../../../adm/root.mk
2+
include $(MFEXT_HOME)/share//simple_layer.mk
3+
4+
all:: $(PREFIX)/lib/python$(PYTHON3_SHORT_VERSION)/site-packages/cartopy/io/.url_naturalearth_fixed
5+
6+
$(PREFIX)/lib/python$(PYTHON3_SHORT_VERSION)/site-packages/cartopy/io/.url_naturalearth_fixed:
7+
cd $(PREFIX)/lib/python$(PYTHON3_SHORT_VERSION)/site-packages/cartopy/io/ && cat shapereader.py | sed -e 's/naciscdn.org\/naturalearth\/{resolution}/naturalearth.s3.amazonaws.com\//' | sed -e 's/\/{category}/{resolution}_{category}/' > shapereader.py.new && mv shapereader.py.new shapereader.py && touch .url_naturalearth_fixed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
url.patch
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff -up Cartopy-0.13.1/lib/cartopy/io/shapereader.py.orig Cartopy-0.13.1/lib/cartopy/io/shapereader.py
2+
--- Cartopy-0.13.1/lib/cartopy/io/shapereader.py.orig 2021-09-02 17:01:12.256120098 +0200
3+
+++ Cartopy-0.13.1/lib/cartopy/io/shapereader.py 2021-09-02 17:05:32.046345376 +0200
4+
@@ -279,8 +279,8 @@ class NEShpDownloader(Downloader):
5+
# Define the NaturalEarth URL template. The natural earth website
6+
# returns a 302 status if accessing directly, so we use the naciscdn
7+
# URL directly.
8+
- _NE_URL_TEMPLATE = ('http://naciscdn.org/naturalearth/{resolution}'
9+
- '/{category}/ne_{resolution}_{name}.zip')
10+
+ _NE_URL_TEMPLATE = ('https://naturalearth.s3.amazonaws.com/'
11+
+ '{resolution}_{category}/ne_{resolution}_{name}.zip')
12+
13+
def __init__(self,
14+
url_template=_NE_URL_TEMPLATE,

0 commit comments

Comments
 (0)