This article is from Python Big data analysis, written by Zhu Weijun

The Python map visualization libraries, known as Pyecharts, Plotly, folium, and the lesser known Bokeh, Basemap, and Geopandas, are also important tools for map visualization. \

This time, let’s take a look at three low-key Python map visualization tools.

Let’s start with Bokeh

Bokeh is good at creating interactive charts, and he’s certainly no slouch at displaying maps.

Sample code address: automating – gis – the processes. Dead simple. IO / 2017 / lesson #…

Here’s a little video to show you:

Video code address: towardsdatascience.com/a-complete-…

Bokeh supports geographic visualization of Google Maps, GeoJSON data and, crucially, dynamic interaction.

The Bokeh website provides a detailed map visualization solution for those interested in sample code.

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

Basemap – Professional map visualization library

It is no exaggeration to say that Basemap is the most awesome third party library for Python map visualization.

Basemap is based on Matplotlib, so it has all the functionality to create data visualizations and must be used with Matplotlib.

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

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
map = Basemap()
map.drawcoastlines()
plt.show()
plt.savefig('test.png')
Copy the code

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()
Copy the code

Thanks to Basemap’s omnipotent drawing capabilities, you can also draw:

The wind hook figure

Outline of the figure

Filled profile

Pseudo color chart

Geotagged map

Flow diagram of vector field

Live map

Multisubgraph map

3 d map

The sample code and basemap learning website: basemaptutorial. Readthedocs. IO/en/latest /

Note: As Basemap only supports Py2, Matplotlib will suspend the maintenance of Basemap, and Cartopy will replace Basemap as the head of map visualization in the Matplotlib camp.

Finally, Geopandas

Geopandas, as its name suggests, is based on pandas’ map visualization tool, so it is very convenient for handling geographic data.

Geopandas is recommended as the main tool for processing geographic information data.

Geopandas geopandAs geopandAs GeopandAs

Geopandas: How easy it is to map in Python!

With matplotlib, very simple code can draw beautiful maps:

\

-END-

Note: the menu of the official account includes an AI cheat sheet, which is very suitable for learning on the commute.

Highlights from the past2019Machine learning Online Manual Deep Learning online Manual AI Basic Download (Part I) note: To join our wechat group or QQ group, please reply "add group" to join knowledge planet (4500+ user ID:92416895), please reply to knowledge PlanetCopy the code

Like articles, click Looking at the