Skip to content

Commit

Permalink
fix natural earth download
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldorman committed Nov 3, 2024
1 parent 9fa66bc commit 12a2566
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions 07-read-write.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,9 @@ To overcome this, we add a header corresponding to a request coming from a brows
```{python}
#| eval: false
# Set URL+filename
url = 'https://www.naturalearthdata.com/http//www.naturalearthdata.com/'
url += 'download/10m/cultural/ne_10m_airports.zip'
url = 'https://naciscdn.org/naturalearth/10m/cultural/ne_10m_airports.zip'
filename = 'output/ne_10m_airports.zip'
# Download
opener = urllib.request.build_opener()
opener.addheaders = [(
'User-agent',
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) ' +
'Gecko/20100101 Firefox/116.0'
)]
urllib.request.install_opener(opener)
urllib.request.urlretrieve(url, filename)
# Extract
f = zipfile.ZipFile(filename, 'r')
Expand Down

0 comments on commit 12a2566

Please sign in to comment.