Fix enum values.
3
.gitignore
vendored
|
@ -24,3 +24,6 @@ precommit.py
|
|||
.idea
|
||||
temp
|
||||
venv
|
||||
|
||||
compare.html
|
||||
taginfo
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<w>betula</w>
|
||||
<w>carto</w>
|
||||
<w>changeset</w>
|
||||
<w>cladr</w>
|
||||
<w>dasharray</w>
|
||||
<w>defs</w>
|
||||
<w>dharmachakra</w>
|
||||
|
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 7.7 MiB After Width: | Height: | Size: 7.7 MiB |
Before Width: | Height: | Size: 315 KiB After Width: | Height: | Size: 319 KiB |
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 348 KiB |
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 199 KiB |
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 207 KiB |
|
@ -241,7 +241,7 @@ class Constructor:
|
|||
if not line.tags:
|
||||
return
|
||||
|
||||
building_mode: str = self.configuration.building_mode
|
||||
building_mode: BuildingMode = self.configuration.building_mode
|
||||
if "building" in line.tags or (
|
||||
building_mode == BuildingMode.ISOMETRIC
|
||||
and "building:part" in line.tags
|
||||
|
|
|
@ -10,45 +10,37 @@ __email__ = "me@enzet.ru"
|
|||
|
||||
|
||||
class DrawingMode(Enum):
|
||||
"""
|
||||
Map drawing mode.
|
||||
"""
|
||||
"""Map drawing mode."""
|
||||
|
||||
NORMAL: str = "normal"
|
||||
AUTHOR: str = "author"
|
||||
TIME: str = "time"
|
||||
NORMAL = "normal"
|
||||
AUTHOR = "author"
|
||||
TIME = "time"
|
||||
|
||||
|
||||
class LabelMode(Enum):
|
||||
"""
|
||||
Label drawing mode.
|
||||
"""
|
||||
"""Label drawing mode."""
|
||||
|
||||
NO: str = "no"
|
||||
MAIN: str = "main"
|
||||
ALL: str = "all"
|
||||
NO = "no"
|
||||
MAIN = "main"
|
||||
ALL = "all"
|
||||
|
||||
|
||||
class BuildingMode(Enum):
|
||||
"""
|
||||
Building drawing mode.
|
||||
"""
|
||||
"""Building drawing mode."""
|
||||
|
||||
NO: str = "no"
|
||||
FLAT: str = "flat"
|
||||
ISOMETRIC: str = "isometric"
|
||||
ISOMETRIC_NO_PARTS: str = "isometric-no-parts"
|
||||
NO = "no"
|
||||
FLAT = "flat"
|
||||
ISOMETRIC = "isometric"
|
||||
ISOMETRIC_NO_PARTS = "isometric-no-parts"
|
||||
|
||||
|
||||
@dataclass
|
||||
class MapConfiguration:
|
||||
"""
|
||||
Map drawing configuration.
|
||||
"""
|
||||
"""Map drawing configuration."""
|
||||
|
||||
drawing_mode: str = DrawingMode.NORMAL
|
||||
building_mode: str = BuildingMode.FLAT
|
||||
label_mode: str = LabelMode.MAIN
|
||||
drawing_mode: DrawingMode = DrawingMode.NORMAL
|
||||
building_mode: BuildingMode = BuildingMode.FLAT
|
||||
label_mode: LabelMode = LabelMode.MAIN
|
||||
zoom_level: float = 18.0
|
||||
overlap: int = 12
|
||||
level: str = "overground"
|
||||
|
|
|
@ -163,7 +163,7 @@ class Point(Tagged):
|
|||
self,
|
||||
svg: svgwrite.Drawing,
|
||||
occupied: Optional[Occupied] = None,
|
||||
label_mode: str = LabelMode.MAIN,
|
||||
label_mode: LabelMode = LabelMode.MAIN,
|
||||
) -> None:
|
||||
"""Draw all labels."""
|
||||
labels: list[Label]
|
||||
|
|
|
@ -635,7 +635,7 @@ class Scheme:
|
|||
texts.append(Label(f"↕ {tags['height']} m"))
|
||||
processed.add("height")
|
||||
for tag in tags:
|
||||
if self.is_writable(tag) and tag not in processed:
|
||||
if self.is_writable(tag, tags[tag]) and tag not in processed:
|
||||
texts.append(Label(tags[tag]))
|
||||
return texts
|
||||
|
||||
|
|