-
Book Overview & Buying
-
Table Of Contents
Python Automation Cookbook - Third Edition
By :
To best way to show information that changes from region to region is to create a map that presents the information in a way that provides a sense of geographic location.
In this recipe, we'll make use of the Geopandas module to import GIS information, as well as matplotlib to display it. We will display a map of Western Europe and show the population of each country with a color grade. The darker the color, the larger the population.
We need to install matplotlib and geopandas in our virtual environment:
$ echo "matplotlib==3.10.8" >> requirements.txt
$ echo "geopandas==1.1.2" >> requirements.txt
$ uv pip install -r requirements.txt
The map data needs to be downloaded. Fortunately there's a lot of freely available geographic information. A search on Google should quickly return almost everything you need, including detailed information on regions, counties, rivers, or any other kind of data.
GIS information...