Commit d2b9f43c authored by Eric Duminil's avatar Eric Duminil
Browse files

Showing OSM info on map

parent bf91b58b
......@@ -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!")
......
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