mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-03 03:11:52 +02:00
Support way element drawing.
This commit is contained in:
parent
c8650e285d
commit
89afd8bb20
1 changed files with 11 additions and 5 deletions
|
@ -13,9 +13,13 @@ def draw_node(tags: Tags, path: Path):
|
|||
grid.draw(path)
|
||||
|
||||
|
||||
def draw_way():
|
||||
def draw_way(tags: Tags, path: Path):
|
||||
"""Draw way."""
|
||||
pass
|
||||
grid: Grid = Grid(show_credit=False, margin=3.5)
|
||||
node_1: OSMNode = grid.add_node({}, 0, 0)
|
||||
node_2: OSMNode = grid.add_node({}, 1, 1)
|
||||
grid.add_way(tags, [node_1, node_2])
|
||||
grid.draw(path)
|
||||
|
||||
|
||||
def draw_area(tags: Tags, path: Path):
|
||||
|
@ -38,7 +42,9 @@ def draw_element(options: argparse.Namespace):
|
|||
tags_description: Tags = {
|
||||
x.split("=")[0]: x.split("=")[1] for x in options.tags.split(",")
|
||||
}
|
||||
if options.type == "area":
|
||||
draw_area(tags_description, Path(options.output_file))
|
||||
elif options.type == "node":
|
||||
if options.type == "node":
|
||||
draw_node(tags_description, Path(options.output_file))
|
||||
elif options.type == "way":
|
||||
draw_way(tags_description, Path(options.output_file))
|
||||
elif options.type == "area":
|
||||
draw_area(tags_description, Path(options.output_file))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue