mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-07 14:16:39 +02:00
Issue #69: fix boundary box.
This commit is contained in:
parent
4b8e5478f5
commit
2ec6a106e9
2 changed files with 4 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,3 +15,5 @@ cache/
|
|||
# Temporary files
|
||||
|
||||
*.swp
|
||||
|
||||
*.egg-info
|
||||
|
|
|
@ -48,7 +48,7 @@ class Tile:
|
|||
"""
|
||||
Code from https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
|
||||
|
||||
:param coordinates: any coordinates inside tile
|
||||
:param coordinates: any coordinates inside tile, (latitude, longitude)
|
||||
:param scale: OpenStreetMap zoom level
|
||||
"""
|
||||
lat_rad: np.ndarray = np.radians(coordinates[0])
|
||||
|
@ -444,14 +444,13 @@ def ui(options: argparse.Namespace) -> None:
|
|||
if boundary_box is None:
|
||||
sys.exit(1)
|
||||
min_tiles: Tiles = Tiles.from_boundary_box(boundary_box, min_scale)
|
||||
extended_boundary_box: BoundaryBox = min_tiles.boundary_box
|
||||
try:
|
||||
osm_data: OSMData = min_tiles.load_osm_data(Path(options.cache))
|
||||
except NetworkError as e:
|
||||
raise NetworkError(f"Map is not loaded. {e.message}")
|
||||
|
||||
for scale in scales:
|
||||
tiles: Tiles = Tiles.from_boundary_box(extended_boundary_box, scale)
|
||||
tiles: Tiles = Tiles.from_boundary_box(boundary_box, scale)
|
||||
tiles.draw(directory, Path(options.cache), configuration, osm_data)
|
||||
else:
|
||||
logging.fatal(
|
||||
|
|
Loading…
Add table
Reference in a new issue