Skip to content

Commit eb68121

Browse files
committed
valhalla_tilepack_download should also work in Python3
fixes #27
1 parent 3a31423 commit eb68121

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

planetutils/tilepack_downloader.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import, unicode_literals, print_function
22
from future.standard_library import install_aliases
33
install_aliases()
4-
from urllib.parse import urlparse, urlencode
4+
from urllib.parse import urlparse, urlencode, urlsplit, urlunsplit, parse_qs
55
from urllib.request import urlopen
66

77
import os
@@ -19,15 +19,15 @@ def download(self, outpath, version='latest', api_token=None, compressed=False):
1919
if version == 'latest':
2020
url = '%s/valhalla_planet_tilepacks/download_latest'%(self.HOST)
2121
# Make url
22-
u = list(urlparse.urlsplit(url))
23-
q = urlparse.parse_qs(u[3])
22+
u = list(urlsplit(url))
23+
q = parse_qs(u[3])
2424
if api_token:
2525
q['api_token'] = api_token
2626
u[3] = urlencode(q)
27-
url = urlparse.urlunsplit(u)
27+
url = urlunsplit(u)
2828
# Download
2929
download.download_curl(url, outpath, compressed=compressed)
30-
30+
3131
def list(self):
3232
url = "%s/valhalla_planet_tilepacks.json"%(self.HOST)
3333
contents = urlopen(url).read()
@@ -60,4 +60,4 @@ def list(self):
6060
a['valhalla_version'],
6161
a['interline_planetutils_version'],
6262
a['interline_valhalla_tile_cutter_version']
63-
))
63+
))

0 commit comments

Comments
 (0)