If you live in downtown Toronto, you probably see a lot of construction, bumper to bumper traffic, and skyscrapers in every direction. But there’s also plenty of trees and green space tucked in alongside those buildings and busy streets. That’s why, according to Newsha Ghaeli, a research associate at MIT’s Senseable City Lab, Toronto ranks in the top 10 greenest cities in the world. Vancouver beat out Toronto, coming in at number two.

Her analysis, which she calls Treepedia, feeds images from Google Street View into an algorithm to compare the percentage of green space to grey space. The algorithm analyzes the images to estimate the percentage of trees from a street-level perspective—which is the perspective most important to the residents of a city. The analysis might not include larger parks since it focused on the green space visible from actual streets.

The resulting score, or Green View Index (GVI) reflects how leafy each city is on a street level. Vancouver came away with a score of 25.9% and Toronto, 19.5%. Since lower amounts of city greenery have been linked with higher stress levels, the analysis could provide some insight into the link between mental health and city living.

According to the Treepedia website, “increasing a city’s tree canopy contributes to lowering urban temperatures by blocking shortwave radiation and increasing water evaporation. Creating more comfortable microclimates, trees also mitigate air pollution caused by everyday urban activities. Their absorptive systems also help avoid floods during severe rains and storm surges.”

Hopefully, Ghaeli’s study will lead to major urban areas making an effort to increase tree planting efforts and start planning for a greener city for future generations.