Commit 50f76a62 authored by Eric Duminil's avatar Eric Duminil
Browse files

Add height information

parent a1cb6c53
......@@ -145,6 +145,7 @@ def place_trees(forest, ways, region, to_local, tree_distance, min_distance_2) -
type='Fake Tree',
description='Tilia tomentosa',
diameter=6,
height=10,
source='add_trees.py'
)
......@@ -234,7 +235,7 @@ def export_shapefile(bounds: Bounds, forest: Forest, tree_distance: float, epsg_
basename = get_basename(bounds)
shp_dir = OUTPUT_DIR / basename
shp_dir.mkdir(exist_ok=True)
gdf.to_file(shp_dir / f"trees.shp")
gdf.to_file(shp_dir / f"trees.shp", encoding='UTF-8')
print(" DONE!")
......
......@@ -13,6 +13,7 @@ def get_existing_forest(shp_input):
diameter=tree_row.Kronenbrei,
type=tree_row.Baumart,
trunk_diameter=tree_row.Stammumfan,
height=tree_row.Baumhöhe,
source=Path(shp_input).name
))
return Forest(trees)
......
......@@ -8,8 +8,8 @@ class Tree:
x: float
y: float
diameter: float
height: float
z: float = 0
height: float = None
trunk_diameter: float = None
type: str = None
description: str = '?'
......@@ -27,7 +27,7 @@ class Tree:
return self.diameter / 2
def __str__(self):
return f"{self.type} ({self.description}), {self.radius} m (X={self.x:.1f}, Y={self.y:.1f})"
return f"{self.type} ({self.description}), {self.radius} m radius, {self.height} m height, (X={self.x:.1f}, Y={self.y:.1f})"
class Forest(UserList):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment