Counting buildings in downtown Lisbon

TLDR: used data from OpenStreetMap and city government to visualize construction permits issued for Lisbon’s historical center. Also made a pretty GIF.

While I was doing research for a short article on tourism, my progress was acutely derailed by a dataset about construction permits (I know, it sounds like a thrilling story already…). I didn’t think much of it myself until I realized it was a shapefile.

The shapefile format is a geospatial vector data format for geographic information system (GIS) software.

In practical terms this means that for each data point, besides information about the project itself (for example if its a demolition, construction or alteration), there was also a polygon describing its shape and its geographical location. This made it easy to plot.

Fig. 1 - Construction permits issued in Lisbon (2010-2019)

This picture showed some potential but it was definitely missing something. First of all, it needed some context. Instead of just drawing the neighborhood borders to contain the data, I thought the best option would be to also plot buildings that were not subject to any development. If only there was some sort of open source alternative to Google Maps.

Fig. 2 - Construction permits and untouched buildings

While this already looks much better, there are way too many buildings in the city to be able to see anything clearly. I decided to focus on the region with the highest density of buildings and construction, the downtown or ‘a baixa’ (dashed circle, neighborhood Santa Maria Maior).

Fig. 3 - Construction in downtown Lisbon

In an attempt to elevate this project into something more than just eye candy, I decided to try and estimate the percentage of buildings that were modified in the last 10 years. This was tricky because of reasons:

  • The polygons in the permit database did not match exactly the ones found on OpenStreetMap;
  • Some permits are issued for a range of addresses, including multiple buildings;
  • Comparing orange area with grey area was not feasible because of exterior projects.

My solution was to define a representative point for every building and then checking each of them to see if they fell within a construction area. The figure below shows an example of how this works.

Fig. 4 - Counting buildings

I just counted black dots that were inside an orange polygon and those that were outside. Using this strategy I estimated that, in the past decade, 1125 buildings out of a total of 2799 were subject to some form of construction project that required a license. That is 40.2%.

Final remarks

It would be interesting to get more details about the purpose of these construction projects.

How many of them were destined for residential or commercial purposes?

How many are public works?

Including this information would allow us to see the bigger picture of what kind of path the city is taking through these developments. Hopefully we would see that not all of them end up as short-term rental apartments or overpriced restaurants.

Finally, because the data spans 10 years and I like to dabble in video editing, here’s a movie:

Guest post by Ricardo Zacarias.

Copyright © 2024 Hoodpicker. All Rights Reserved.