mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-07 13:21:49 +02:00
Fix tag parsing.
This commit is contained in:
parent
1848bfe367
commit
6ffa91344a
1 changed files with 5 additions and 3 deletions
|
@ -262,15 +262,17 @@ class Tree(Tagged):
|
||||||
"""Draw crown and trunk."""
|
"""Draw crown and trunk."""
|
||||||
scale: float = flinger.get_scale(self.coordinates)
|
scale: float = flinger.get_scale(self.coordinates)
|
||||||
radius: float
|
radius: float
|
||||||
if "diameter_crown" in self.tags:
|
diameter_crown: Optional[float] = self.get_float("diameter_crown")
|
||||||
|
if diameter_crown is not None:
|
||||||
radius = float(self.tags["diameter_crown"]) / 2.0
|
radius = float(self.tags["diameter_crown"]) / 2.0
|
||||||
else:
|
else:
|
||||||
radius = 2.0
|
radius = 2.0
|
||||||
color: Color = scheme.get_color("evergreen_color")
|
color: Color = scheme.get_color("evergreen_color")
|
||||||
svg.add(svg.circle(self.point, radius * scale, fill=color, opacity=0.3))
|
svg.add(svg.circle(self.point, radius * scale, fill=color, opacity=0.3))
|
||||||
|
|
||||||
if "circumference" in self.tags:
|
circumference: Optional[float] = self.get_float("circumference")
|
||||||
radius: float = float(self.tags["circumference"]) / 2.0 / np.pi
|
if circumference is not None:
|
||||||
|
radius: float = circumference / 2.0 / np.pi
|
||||||
svg.add(svg.circle(self.point, radius * scale, fill="#B89A74"))
|
svg.add(svg.circle(self.point, radius * scale, fill="#B89A74"))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue