Spain lives in flats: why we have built our cities vertically

Country/area: Spain

Organisation: elDiario.es

Organisation size: Big

Publication date: 30/09/2021

Credit: Raúl Sánchez, Analía Plaza


Raúl Sánchez:  Spanish data and investigative journalist covering stories of inequality, gender, corruption and (now) Covid at elDiario.es. He coordinates elDiario.es data team.
Analía Plaza: Spanish journalist specialized in new economy, urbanism, transport and local stories. He worked as a reporter in several large media in Spain such as El Confidencial, elDiario.es, El Periódico de España and El País.

Project description:

Two of every three Spaniards live in flats and apartments and only a third in single-family and semi-detached houses. “Spain lives in flats” is an innovative and  interactive journalistic project by elDiario.es that analyzes the footprint of more than 12 million buildings  to map the height of Spanish cities in 3D to analyze their sustainability and impact on the current urban society. The investigation that includes narrative visualizations shows why Spain is one of the countries in the world that has built the highest and most dense cities compared to other countries.

Impact reached:

This project compiled for the first time in a single database the cartographic plans of all the buildings currently standing in the Spanish territory. The map, which can be consulted by all readers, allows the users to understand the vertical urbanism that has characterized Spanish cities in the last century. The innovative format allows readers to explore the heights of their buildings in three dimensions while we explain with graphics and data the urban decisions that were made in each decade, along with the socioeconomic context of each moment. Furthermore, the project used solutions journalism techniques by explaining and proposing several sustainable models for the European cities of the future based on many interviews with experts and the analysis of the mistakes and challenges of urban planning discovered in the historical data analyzed for the project.
This project has proved that innovative narratives are useful and welcomed by elDiario.es users. This project was also a bet to publish for the first time content in English, due to the importance of giving access to first time published data to an international audience. The publication has been viewed by more than 200.000 users and it was one of the most read of the year in elDiario.es and also one of the articles that made most people subscribe and pay to support elDiario.es during the year, according to our statistics. Added to this, the publication doubled the average time of view of a usual article in elDiario.es. This project was also an opportunity to work with our local editions that made specific publications for their local audience using the project content. 

Techniques/technologies used:

R, Rstudio, QGIS and Tippecanoe for data compiling and data analysis. D3.js and Javascript for data visualization. Mapbox for mapping buildings footprint. HTML, Javascript and Scrollama for scroll webpage.

What was the hardest part of this project?

The hardest part of the project was compiling and automating the download of the building footprint of more than 12 million buildings and processing that amount of information. We created an R script that downloaded cadastral data of the buildings of more than 7,600 municipalities, one by one. The total size of the downloaded files exceeded 200GB. During the processing of the data, the journalists found errors in the files that were later corrected after notifying the cadastral institution.
Then, we processed and joined in R all downloaded files to have a single database with the details of all the buildings in Spain. For example, we verified the data of 12 million buildings, we calculated the height of every building from the part that occupies the most built volume in the plans and we extracted the date of the building from the start of construction. All these processes were repeated several times during the year due to the publication of corrections and allowed us for the first time in Spain to have a database and a visualization with the heights of all the buildings in the country.
In addition, Tippecanoe was used with different configurations to reduce the size of the files and thus be able to work with it in Mapbox.

What can others learn from this project?

This project shows how the information available in national cadastres could be exploited in other countries to explain the urban planning of each territory and to tell stories of how other cities were built and find solutions to create more friendly and sustainable cities. The page format and interactive visualization are also part of one of elDiario.es’ long-term bet to give their readers informative content in innovative format by promoting collaborative work between traditional journalists and the data and visualization team.

Project links: