Ookla Server KDE Plotting
This notebook was created to map Ookla server locations as a Kernel Density Estimation (KDE) geographic map plot. Currently, it maps server locations in the contiguous United States and World Map at varying levels of granularity.
Running Notebook
The notebook using Geopandas and Geoplot. This means that you will need to set up a virtual environment. Personally, I used this Medium article by Tanish Gupta to set up my environment.
To run the notebook:
- Activate conda virtual env that has Geopandas by running the following command in Anaconda Prompt
conda activate yourenv
- Launch notebook menu using:
jupyter notebook
- Navigate to notebook and run
Details
One of things you'll notice when you look at this repository is the folders world
and world_transparent
that contain KDE geoplots of only continents. This is caused by the inability to control the granularity when plotting a KDE geoplot using Geoplot. To remedy this, I...
- Plotted points continent by continent and saved the figs to
.png
files. - Drew transparencies everywhere on the image except for the mapped area and country borders.
- Overlay the images and create a legend/scale using Figma.
An issue I faced when doing this was the scale. When I plotted continent by continent, each continent would have the same max level of density (regardless of actual density relative to each other).
Notice how Africa has the same density as Europe and other continents
To fix this, I created individual color scales based on the number of servers on each continent relative to the continent that has the most servers (South America). This allowed the scale to be accurate.
Africa is considerably less intense compared to before
Potential Improvements
- The world map could have a higher level of granularity. However, this would mean plotting a KDE geoplot for every single country and following the process listed above.
- Due to convenience of the packages, I filtered out some countries (Kosovo (XK), East Timor (TL), etc.) . It would be possible to hard code these situations.