3 Types of Map Data Visualization in Python

What is map data visualization?

Before we start to make map data visualization, we need to know what is it?

To be simple, map data visualization is to transform geographic data into a visual form. By visualizing the data with regional characteristics or the results of data analysis on the map, users can more easily understand the laws and trends of data.

In layman’s terms, map visualization can present geographic data more clearly and directly. It can’t be denied that Maps are the most commonly used form of data visualization today. Good map visualization integrates information into geographic context, contains a lot of information, and is extremely aesthetically pleasing and shocking.

Tools to achieve map data visualization

At present, there are many tools that can implement map data visualization, which can be divided into three types: programming, platform, and software:

Programming: Matlab, Python, Echarts

Platform: FineReport, Tableau, Power BI

Software: Excel

For most people, Excel has always been the first choice, but is Excel really the best tool for map visualization?

In this article, I will introduce the advantages and disadvantages of the above three types of tools, and focus on the map data visualization in python. I hope you can find a tool that meets your needs.

Python is one of the easier to get started in programming languages, and can very efficiently implement map data visualization of large amounts of data.

The Python map visualization library has well-known pyecharts, plotly, folium, as well as slightly low-key bokeh, basemap, geopandas, they are also a weapon that cannot be ignored for map visualization.

Next, I will introduce these three low-key python map visualization tools.

First is bokeh

Bokeh is good at making interactive graphics, and of course, it is not inferior to map data visualization.

For example, like this

And this

Code link: https://automating-gis-processes.github.io/2017/lessons/L5/interactive-map-bokeh.html

Bokeh supports the geographic visual display of Google maps and JSON data. The most important is it can realize dynamic interaction.

Bokeh‘s official website provides detailed map visualization solutions. If you are interested in it, you can pull out the sample code and run.

Learning website: https://docs.bokeh.org/en/lates

Next is basemap

It is no exaggeration to say that basemap is the best third-party library for python map visualization.

Basemap is developed based on matplotlib, so it has all the functions to create a data visualization, and must be used with matplotlib.

It only takes a few lines of code to draw a world map:

from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt map = Basemap() map.drawcoastlines() plt.show() plt.savefig(‘test.png’)

from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt map = Basemap(projection=’ortho’,lat_0=0, lon_0=0) #Fill the globe with a blue color map.drawmapboundary(fill_color=’aqua’) #Fill the continents with the land color map.fillcontinents(color=’coral’,lake_color=’aqua’) map.drawcoastlines() plt.show()

Note: Because basemap supports py2, and py2 has been discontinued, basemap is also abandoned by matplotlib. It is replaced by cartopy, which supports py3 and perfectly integrates matplotlib.

Finally is geopandas

Geopandas, as the name suggests, is a map data visualization tool based on pandas, so it is very convenient for processing geographic data.

It is recommended that you use geopandas as the main tool for geographic information data processing. Next, I will write a clear guide on how to use geopandas for you!

Map Data Visualization Platforms

In fact, in addition to using python, we can directly use some data visualization tools to accomplish this. There are many such softwares on the market today, such as Tableau and PowerBI, which are more suitable for professional data analysts, these softwares have complete functions and very friendly interaction.

But for some data visualizations that just want to show research results, FineReport and some online websites(ArcGIS Online Platform) which can generate map charts may be a better choice. Most of them are free and can also provide excellent map display.

Here are some map data visualization images made by FineReport.

Heatmap of earthquake frequency in Southeast Asia

3D Earth

Excel

Excel is a familiar office software, but it is also a reliable map visualization software. For those who do not want to spend time choosing other tools, Excel is undoubtedly a very good choice. In the 2016 version of the Excel tab, you can directly choose to insert a 3D map. You only need to obtain geographic data, and then follow the normal chart settings to complete a beautiful map data visualization.

About an Excel guide, you can follow I Made a Dynamic Hurricane Map with Excel!

This guide will teach you how to make a hurricane map step by step!! Is it amazing？

You might also be interested in…

Top 16 Types of Chart in Data Visualization

How Can Beginners Design Cool Data Visualizations?

3 Types and 5 Management Dashboard Examples Sorted by Departments

Partly sourced from https://zhuanlan.zhihu.com/pydatalysis

Author: zhuweijun