Commit 9693496d authored by Eric Duminil's avatar Eric Duminil
Browse files

Random roads

parent 2ffd890f
......@@ -39,6 +39,7 @@ from export_OSM_roads_to_csv import write_roads_to_csv
# From RegionChooser, or https://wktmap.com/
# Case-study for Grombühl Paper. (4 Blocks):
WKT = "POLYGON((9.942183 49.804010, 9.942301 49.802740, 9.945477 49.802698, 9.945563 49.804014, 9.942167 49.804055, 9.942183 49.804010))"
WKT = "POLYGON ((9.940352 49.804078, 9.942176 49.804646, 9.949343 49.804508, 9.953356 49.804383, 9.954686 49.804355, 9.955094 49.801932, 9.951661 49.800422, 9.949 49.800796, 9.94591 49.800713, 9.941339 49.801724, 9.94061 49.802527, 9.940352 49.804078))"
# Grafenbühl:
# WKT = "POLYGON((9.147551 48.908059, 9.148635 48.907953, 9.149525 48.907819, 9.151177 48.907819, 9.151413 48.907840, 9.153226 48.908087, 9.153387 48.906705, 9.149160 48.906634, 9.148999 48.906620, 9.147551 48.908059))"
......@@ -73,10 +74,13 @@ TREE_SPECIES = {
'Acer platanoides': 0.5
}
TREE_CROWN_DIAMETER = 8 # [m]
TREE_CROWN_DIAMETER = [4, 6, 8] # [m]
TREE_HEIGHT = [8, 10, 12] # [m]
TREE_TRUNK_DIAMETER = 90 # [cm]
# Percentage of roads to which trees should be added
ROAD_PERCENTAGE = 50
########################
# STREETS #
########################
......@@ -220,6 +224,10 @@ def place_trees(forest: Forest, ways: list, region: str, to_local, tree_distance
# Unknown
color = 'gray'
if random.random() * 100 > ROAD_PERCENTAGE:
continue
road_xy_s = [to_local.transform(node.lon, node.lat) for node in way.nodes]
tree_path = LineString(road_xy_s)
......
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