mirror of
https://github.com/enzet/map-machine.git
synced 2025-04-29 18:27:19 +02:00
Add documentation for elements.
This commit is contained in:
parent
c0879bff36
commit
c5bee25391
1 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
"""Entry point for element drawing: nodes, ways, and relations."""
|
||||||
import argparse
|
import argparse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -6,16 +7,19 @@ from map_machine.osm.osm_reader import Tags, OSMNode
|
||||||
|
|
||||||
|
|
||||||
def draw_node(tags: Tags, path: Path):
|
def draw_node(tags: Tags, path: Path):
|
||||||
grid: Grid = Grid(show_credit=False, margin=0.5)
|
"""Draw separate node."""
|
||||||
|
grid: Grid = Grid(show_credit=False, margin=3.5)
|
||||||
grid.add_node(tags, 0, 0)
|
grid.add_node(tags, 0, 0)
|
||||||
grid.draw(path)
|
grid.draw(path)
|
||||||
|
|
||||||
|
|
||||||
def draw_way():
|
def draw_way():
|
||||||
|
"""Draw way."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def draw_area(tags: Tags, path: Path):
|
def draw_area(tags: Tags, path: Path):
|
||||||
|
"""Draw closed way that should be interpreted as an area."""
|
||||||
grid: Grid = Grid(show_credit=False, margin=0.5)
|
grid: Grid = Grid(show_credit=False, margin=0.5)
|
||||||
node: OSMNode = grid.add_node({}, 0, 0)
|
node: OSMNode = grid.add_node({}, 0, 0)
|
||||||
nodes: list[OSMNode] = [
|
nodes: list[OSMNode] = [
|
||||||
|
@ -30,7 +34,7 @@ def draw_area(tags: Tags, path: Path):
|
||||||
|
|
||||||
|
|
||||||
def draw_element(options: argparse.Namespace):
|
def draw_element(options: argparse.Namespace):
|
||||||
|
"""Entry point for element drawing."""
|
||||||
tags_description: Tags = {
|
tags_description: Tags = {
|
||||||
x.split("=")[0]: x.split("=")[1] for x in options.tags.split(",")
|
x.split("=")[0]: x.split("=")[1] for x in options.tags.split(",")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue