Skip to content

Commit

Permalink
Merge pull request #14 from Kanahiro/fix/ext
Browse files Browse the repository at this point in the history
Fix/ext
  • Loading branch information
Kanahiro authored Mar 4, 2024
2 parents b50f258 + da1b0c5 commit fdd5b4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tileget"
version = "0.3.0"
version = "0.3.1"
description = "Tile download utility - easily download xyz-tile data"
authors = ["Kanahiro <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions tileget/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def main():
geom_3857 = shapely.ops.transform(transformer.transform, geometry)

def download(tile):
basepath = args["tileurl"].split("/")[-1] # ?foo=bar&z={z}.ext
segments = basepath.split(".")
ext = "." + segments[-1] if len(segments) > 1 else ""
# detect file extension from tileurl
# tileurl = https://path/to/{z}/{x}/{y}.ext?foo=bar...&hoge=fuga.json
ext = os.path.splitext(args["tileurl"].split("?")[0])[-1]

write_dir = os.path.join(args["output_dir"], str(tile[2]), str(tile[0]))
write_filepath = os.path.join(write_dir, str(tile[1]) + ext)
Expand Down

0 comments on commit fdd5b4f

Please sign in to comment.