Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CircularGreenSimCity
CircularGreenSimCity
Commits
5b3c5107
Commit
5b3c5107
authored
Nov 08, 2024
by
Eric Duminil
Browse files
add_trees: refactor
parent
958fde5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
python_scripts/add_trees_to_open_street_map/add_trees.py
View file @
5b3c5107
...
...
@@ -55,6 +55,11 @@ TREE_DISTANCE = 25 # [m]
# Unless there's already another tree closer than MIN_DISTANCE away:
MIN_DISTANCE
=
10
# [m]
TREE_SPECIES
=
'Acer platanoides'
# Should be known by Tree-DB
TREE_CROWN_DIAMETER
=
8
# [m]
TREE_HEIGHT
=
12
# [m]
TREE_TRUNK_DIAMETER
=
90
# [cm]
########################
# STREETS #
########################
...
...
@@ -211,10 +216,10 @@ def place_trees(forest: Forest, ways: list, region: str, to_local, tree_distance
forest
.
add_tree_if_possible
(
min_distance_2
,
x
,
y
,
color
=
'#DFFF00'
,
type
=
'Fake Tree'
,
description
=
'Tilia tomentosa'
,
diameter
=
6
,
# [m]
height
=
10
,
# [m]
trunk_diameter
=
50
,
# [cm]
description
=
TREE_SPECIES
,
diameter
=
TREE_CROWN_DIAMETER
,
# [m]
height
=
TREE_HEIGHT
,
# [m]
trunk_diameter
=
TREE_TRUNK_DIAMETER
,
# [cm]
source
=
'add_trees.py'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment