Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 17, 2024
1 parent bd1c4ec commit 3d97d77
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions osm_fieldwork/basemapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
import argparse
import concurrent.futures
import logging
import os
import queue
import re
import shutil
import sys
import os
import threading
from io import BytesIO
from pathlib import Path
Expand All @@ -41,7 +42,6 @@
from pySmartDL import SmartDL
from shapely.geometry import shape
from shapely.ops import unary_union
import shutil

from osm_fieldwork.sqlite import DataFile, MapTile
from osm_fieldwork.xlsforms import xlsforms_path
Expand Down Expand Up @@ -381,6 +381,7 @@ def tileExists(
log.debug("%s doesn't exists" % filespec)
return False


def tileid_from_xyz_dir_path(filepath: Union[Path, str], is_xy: bool = False) -> int:
"""Helper function to get the tile id from a tile in xyz directory structure.
Expand Down Expand Up @@ -596,13 +597,13 @@ def create_basemap_file(
raise ValueError(msg) from None
log.info(f"Wrote {outfile}")


def move_tiles(
boundary=None,
indir=None,
outdir=None,
) -> None:
"""
Move tiles within a boundary to another directory. Used for managing the
"""Move tiles within a boundary to another directory. Used for managing the
map tile cache.
Args:
Expand Down Expand Up @@ -717,12 +718,12 @@ def main():
)

if args.move is not None and args.outdir is None:
log.error(f"You need to specify the new tile cache directory!")
log.error("You need to specify the new tile cache directory!")
parser.print_help()
quit()
else:
move_tiles(boundary_parsed, args.move, args.outdir)
return
move_tiles(boundary_parsed, args.move, args.outdir)
return

create_basemap_file(
boundary=boundary_parsed,
Expand Down

0 comments on commit 3d97d77

Please sign in to comment.