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
d2b9f43c
Commit
d2b9f43c
authored
Feb 17, 2025
by
Eric Duminil
Browse files
Showing OSM info on map
parent
bf91b58b
Changes
1
Hide whitespace changes
Inline
Side-by-side
python_scripts/add_trees_to_open_street_map/add_trees.py
View file @
d2b9f43c
...
...
@@ -212,6 +212,8 @@ def place_trees(forest: Forest, ways: list, region: str, to_local, tree_distance
for
way
in
ways
:
way_type
=
way
.
tags
.
get
(
"highway"
)
width
=
get_width
(
way
)
way
.
type
=
way_type
way
.
width
=
width
default_width
=
default_widths
.
get
(
way_type
,
0
)
if
default_width
<
0
:
# Ignore this type of streets
...
...
@@ -296,6 +298,7 @@ def export_map(bounds: Bounds, forest: Forest, ways: list, epsg_id: int) -> None
folium
.
PolyLine
([(
node
.
lat
,
node
.
lon
)
for
node
in
way
.
nodes
],
color
=
'blue'
,
weight
=
5
,
tooltip
=
f
'
{
way
.
type
}
(
{
way
.
width
}
m)'
,
opacity
=
0.5
).
add_to
(
interactive_map
)
for
tree
in
forest
:
...
...
@@ -323,6 +326,7 @@ def export_map(bounds: Bounds, forest: Forest, ways: list, epsg_id: int) -> None
folium
.
ClickForMarker
(
"New tree here!<br/>at <b>Lat:</b> ${lat}<br /><b>Lon:</b> ${lng}"
).
add_to
(
interactive_map
)
interactive_map
.
save
(
OUTPUT_DIR
/
f
"
{
get_basename
(
bounds
)
}
_trees.html"
)
print
(
" DONE!"
)
...
...
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