A visualization of street-tree density across Copenhagen, helping you find greener routes and see where street-tree coverage varies across the city.
This project analyzes the density of street trees in Copenhagen by calculating the number of trees per 100 meters for each street segment. The data is sourced from OpenStreetMap and visualized using MapLibre GL JS.
Studies have shown that higher street-tree density is associated with better mental health indicators and improved thermal comfort through shade and cooling.
- Tree Density Heatmap: Streets are colored based on trees per 100m.
- Surface Filtering: Filter streets by surface type (asphalt, cobblestone, etc.).
- Individual Trees: Toggle the visibility of individual tree points.
- Street View Integration: Click any street segment to open it in Google Street View.
- Tiled Loading: Large GeoJSON datasets are split into geographic tiles for performance.
process_data.py: Python script usingosmnxandgeopandasto fetch OSM data and calculate tree density.split_geojson.py: Utility to split large GeoJSON files into a grid of tiles for the web.website/: The frontend visualization built with MapLibre GL JS.trees.geojson&streets.geojson: Processed data files (not included in repo if large).
- Install dependencies:
pip install -r requirements.txt
- Run the data processing script:
python process_data.py
- Split the data into tiles for the website:
python split_geojson.py
To view the map locally, serve the website directory:
cd website
python3 -m http.server 8000Then open http://localhost:8000 in your browser.
- OpenStreetMap: Street and tree data.
- Copenhagen Municipality: Urban nature guidelines and data.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Made with ❤️ by Peter Pihlmann Pedersen
