-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinfo.txt
More file actions
100 lines (60 loc) · 7.26 KB
/
info.txt
File metadata and controls
100 lines (60 loc) · 7.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
https://towardsdatascience.com/best-libraries-for-geospatial-data-visualisation-in-python-d23834173b35
Geospatial data is everywhere, and with COVID-19 visualisations, we see a spike in using Geospatial data visualisations tools. For python users, we have several powerful spatial data visualisation libraries. In this article, I will share some of the best packages for geospatial data visualisation in the Python ecosystem.
We cover the top 6 Geospatial data visualisation libraries in Python and the functionalities they offer with some examples.
1. PyViz/HoloViz(Geoviews, Datashader, HvPlot)
Holoviz maintained libraries have all data visualisations you might need, including dashboards and interactive visualisation. Geoviews, in particular, with its dedicated Geospatial data visualisation library, provides an easy to use and convenient geospatial data.
GeoViews is a Python library that makes it easy to explore and visualize geographical, meteorological, and oceanographic datasets, such as those used in weather, climate, and remote sensing research.
Geoviews API provides an intuitive interface and familiar syntax. To plot a geospatial data with Geoviews is very easy and offers interactivity. Let us see an example, which uses Geopandas dataset.
import geoviews as gv
imporg geopandas as gpd
gv.Polygons(gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')), vdims=['pop_est', ('name', 'Country')]).opts(
tools=['hover'], width=600, projection=crs.Robinson()
)
World countries plot — Geoviews
A beginners guide tutorial for Geoviews is available here if you want to get started.
Interactive Geospatial Data Visualization with Geoviews in Python
Beginners Guide on how to get started using Geoviews.
towardsdatascience.com
Besides, PyViz ecosystem provides other libraries that can handle geospatial data, including hvPlot, which can take your data visualisation to the next level.
HvPlot allows users to work with different data types and can extend the usage of other Python libraries including Pandas, Geopadnas, Dask and Rapids.
Datashader is also another must-have data visualisation library for Geospatial data scientists who deal with big data. It breaks the process into multiple steps and runs parallel to create a visualisation for large datasets quickly.
Finally, Panel, a high-level app and dashboarding solution for Python provide an easy to use interface on creating interactive web apps and dashboards using Jupyter notebooks.
2. Folium
Folium is widely used in geospatial data visualisation. It is built on top of Leaflet.js and can cover most of your mapping needs in Python with its great plugins.
Folium builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js library. Manipulate your data in Python, then visualize it in a Leaflet map via folium.
Getting started with Folium is easy, and you can simply call Folium.Map to visualise base maps immediately. You can then add layers to visualise your data on the interactive base maps available in Folium.
import folium
m = folium.Map(location=[45.5236, -122.6750])
m
Here are some examples of using Folium Library functionalities and plugins.
Cluster Markers (Left) — Choropleth Map (Right) with Folium
3. Plotly/Plotly Express
Plotly and its high-level API library Plotly Express have an extensive geospatial data visualisation capabilities. Although there is some missing native support for Geopandas GeoDataFrame, the library boasts many mapping types with an easy to use API. With the introduction of Plotly Express in 2019, creating geospatial visualisations with Plotly has become more accessible.
Take for example this animated Choropleth Map with Plotly Express done with one line of code. Compared to other libraries, achieving this might require you to write a lot of code and hack through different solutions.
With Dash, a widely used and most download web app in data science, Plotly offers a complete solution to deploying web apps. With Plotly Express intuitive API and Dash Plotly, you can take your geospatial web applications and visualisations to the next level.
Plotly Geospatial Data visualisation Galery examples.
4. KeplerGL
kepler.gl for Jupyter is an excellent tool for big Geospatial data visualisation. It combines a world-class visualisation tool, an easy to use User interface (UI), and flexibility of python and Jupyter notebooks.
With just a few lines of code and easy to use interface within Jupyter notebooks, you can create aesthetically pleasing geospatial data visualisation with Kepler GL for Jupyter Python library. The following GIF showcases some of the 3D mapping possibilities with Kepler GL in Python.
kepler.gl is a web-based visualisation tool for large Geospatial datasets built on top of deck.gl. Uber made it an open-source in 2018, and its functionality is impressive. You can easily drag and drop your dataset and tweak it immediately on the web to visualise large scale geospatial datasets with ease.
Kepler GL web interface
The web interface of Kepler GL is excellent. However, if you love working with Jupyter notebooks, the same functionality is now available in Jupyter notebooks. Getting started to use Kepler GL for Jupyter notebook is easy. You can consult with this resource to get you up and running with no time.
Kepler.GL & Jupyter Notebooks: Geospatial Data Visualization with Uber’s opensource Kepler.GL
Plot Geospatial data inside Jupyter notebook & Easily interact with Kepler’s User interface to tweak the visualisation.
towardsdatascience.com
5. IpyLeaflet
IpyLeaflet is another impressive Geospatial data visualisation tool that is built on top of Jupyter Widgets and Leaflet visualisation library. Therefore, if you like using Folium library, you should feel in the right place using IpyLeaflet and Jupyter notebooks.
The interactive functionality in IpyLeaflet is unparalleled as Widgets enable bidirectional interactions. Therefore, your maps are not only interactive but also can capture user inputs to trigger new computations.
Take, for example, The split map control which can be used to compare to different IpyLeaflet layers.
6. Geopandas
Geopandas Example Gallery
If you happen to process or wrangle geospatial data in Python, Geopandas needs no introduction. It is the workhorse of doing geospatial data science and does many of the heavy liftings in processing geospatial data.
I always end visualising static maps with Geopandas, because it is quick and easy to plot maps with Geopandas with its .plot interface. The major downside was that it only offered static maps.
However, recent advances and additions of Contextily for base maps and IPYMPL for interactive matplotlib plots makes it straightforward to create interactive maps with Geopandas.
Interactive Geopandas map with Ipympl
The above GIF showcases the interactivity of Geopandas plots with Ipympl. If you want to get started and use this interactivity, this is a beginners guide blog post.
How to produce Interactive Matplotlib Plots in Jupyter Environment
Create Interactive Plots/maps with All Python libraries that use Matplotlib
towardsdatascience.com
Conclusion
This article shares some of the best geospatial data visualisation tools available in the Python ecosystem. We have covered the top 6 geospatial visualisation libraries in Python. Let me know if you think we miss some libraries here.