Plotting geospatial data in Python
One of Python's greatest strengths is the number and diversity of available packages that make many complex tasks simple, as someone else has already written most of the code. As a result, we sometimes encounter the paradox of choice where too many options confuse the issue and we just want one good option. In this recipe, we will plot a set of latitude and longitude coordinates using an excellent Python package: folium
- that wraps a JavaScript library, which is leaflet.js
. You will learn more about folium further along in the recipe.
Getting ready
You will need the geographic data extracted in the previous recipes (a set of longitude and latitude coordinates). Also, we need to install the folium
package, which is shown in the following section, so you will need an internet connection.
How to do it...
The following steps will help you convert the latitude and longitude data you have to plot on a map:
- Open your terminal. We need to install the Python package...