mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-06 10:09:52 +02:00
Issue #47: change tile UI options.
This commit is contained in:
parent
5a54e2ca2a
commit
0cd45dbdaf
1 changed files with 4 additions and 6 deletions
|
@ -6,7 +6,7 @@ See https://wiki.openstreetmap.org/wiki/Tiles
|
||||||
import argparse
|
import argparse
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple, Optional
|
from typing import Tuple, Optional, List
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import svgwrite
|
import svgwrite
|
||||||
|
@ -173,15 +173,13 @@ def ui(args) -> None:
|
||||||
Simple user interface for tile generation.
|
Simple user interface for tile generation.
|
||||||
"""
|
"""
|
||||||
parser: argparse.ArgumentParser = argparse.ArgumentParser()
|
parser: argparse.ArgumentParser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-lat", required=True)
|
parser.add_argument("-c", required=True)
|
||||||
parser.add_argument("-lon", required=True)
|
|
||||||
parser.add_argument("-s", required=True)
|
parser.add_argument("-s", required=True)
|
||||||
options = parser.parse_args(args)
|
options = parser.parse_args(args)
|
||||||
|
|
||||||
directory: Path = Path("tiles")
|
directory: Path = Path("tiles")
|
||||||
directory.mkdir(exist_ok=True)
|
directory.mkdir(exist_ok=True)
|
||||||
tile: Tile = Tile.from_coordinates(
|
coordinates: List[float] = list(map(float, options.c.split(",")))
|
||||||
np.array((float(options.lat), float(options.lon))), int(options.s)
|
tile: Tile = Tile.from_coordinates(np.array(coordinates), int(options.s))
|
||||||
)
|
|
||||||
tile.draw(directory)
|
tile.draw(directory)
|
||||||
print(tile.get_carto_address())
|
print(tile.get_carto_address())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue