block by martgnz 1e5d9eb712075d8b8c6f7772a95a59f1

Barcelona Metro

Full Screen

Barcelona’s metro stations colored by lines.

Disclaimer: It was surprisingly difficult to make this map.

The local transport authority publishes an CSV with the stations and their coordinates. The problem? They are set in UTM31 ED50. This is not EPSG:4326, the standard for web mapping libraries, so I had to convert them with this tool.

After that I had another problem: the resolution was too high. They don’t publish every station, they publish every station exit. For making the final map I had to clean the data with OpenRefine and leave just one exit for every station.

The data is also outdated. Four months later, there’s nothing about the new L9 branch to the airport.

Data: TMB. Cleaned data. Map data.

The dataset featured on this map is a bit different than the cleaned one. As I said before, I left one exit for every station. Apart from that, some stations were featured on the same row with multiple lines (L6,L7 CATALUNYA). I moved every station to its own row with slightly different coordinates for each line.

index.html

data.csv