I have always loved looking at maps. I find them fascinating as they come in map forms (street, geology, land cover etc) that show can show a great deal of spatial information. It was this passion which persuaded me to study Geography and Geology at University and I loved specialising in Geographical Information Systems as it allowed me to create my own maps in a professional environment. Since my undergraduate days I relied too much on the Esri ArcPro environment which is only available under licence and can be quite expensive for making maps as a hobby. Yes, there is QGIS but I really wanted to learn how to map geographical data through python code. The major benefit of coding is that you have complete control over the process. I first experienced coding with python when I attended two NCAS scientific computing courses in 2018. Since then I didn’t have access to the resources to carry on coding (Linux in particular) until this year when I purchased a desktop pc for myself (waahey!).
Refreshing my Linux and python knowledge
So before I actually jumped into coding maps with python I had to refresh my knowledge and actually relearn the Linux environment. I first had to run a linux environment from my windows OS and then install anaconda from the command line. I used the tutorial below to run kali-linux on my system.
Refreshing my NCAS training
The next step was to refresh my NCAS training. This was a great exercise to do and I really enjoyed my time on the course. The jupyter-notebooks are available on my Github:
The next task was to refresh basic python knowledge. During lockdown I learnt basic python via the freecodecamp Youtube channel. I create a python repo which will be updated with random python scripts which will support support my on going learning.
Now for mapping in python….
I now had a refresh on using python for geographic data it was now time to use my own dataset to support my knowledge. I love eurovision and I really wanted to geographically show how many times a country has won the contest. Whilst the statiscal analysis was evaluated with a PostgreSQL database and R; the map production work was done in a python environment using the geopandas package! I was so happy to produce the following map:
Now there is still room for improvement (the labelling!), but I was so happy to be able to create this data from scratch and it looks like a pretty decent map. During this project I learnt how to merge tables, reproject map projections and create polygons with code! Basic GIS processes that I was so used to in Esri ArcPro. The repo for this project is available at: