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