To create a map, one has to style the GIS data and present it in a form that is visually informative. There are a large number of options available in QGIS to apply different types of symbology to the underlying data. In this tutorial, we will take a text file and apply different data visualization techniques to highlight spatial patterns in the data.
We will take a CSV file containing the location of all power plants in the world and create a visualization showing distribution of renewable and non-renewable fuels used in these power plants.
World Resources Institute has compiled a comprehensive, open source database of power plants around the world covering over 30000 plants. Download the The Global Power Plant Database from the WRI Open Data Portal.
Natural Earth has several global vector layers. Download the 10m Physical Vectors - Land containing Land polygons.
For convenience, you may directly download a copy of the above layers from below:
globalpowerplantdatabasev120.zip
Data Source [WRI] [NATURALEARTH]
ne_10m_land
folder and select the ne_10m_land.shp
layer. Drag the layer to the canvas.ne_10m_land
added to the Layers panel. The global power plant database comes as a CSV file, so we will need to import it. Click the Open Data Source Manager button on the Data Source Toolbar. You can also use Ctrl + L
keyboard shortcut.globalpowerplantdatabasev120.zip
file. Select the global_power_plant_database.csv
. QGIS will auto detect the delimiter and geometry fields. Leave the Geometry CRS to the default value of EPSG:4326 - WGS84
. Click Add followed by Close.global_power_plant_database
will be added to the Layers panel and you will see the points representing the power plants in the canvas. Now we are ready to style both these layers. Click the Open the Layer Styling panel button at the top of the Layers panel.ne_10m_land
layer first. This will be our base layer so we can keep the styling minimalistic so it is not distracting. Click Simple fill
and scroll down. Select a Fill color as per your liking. Click the drop-down next to Stroke color and select Transparent Stroke
. This will set the outlines of the land polygons to be transparent. You will see the result of your selection applied immediately to the layer.global_power_plant_database
layer. Click on Simple marker
and scroll down. Pick a triangle marker.darker(@symbol_color, 130)
Note
Note that this expression is independent of the fill color you have chosen. You will see that this is immensely useful in the following steps where it automatically sets the border color based on the fill color provided.
Categorized
renderer.global_power_plant_database
layer contains an attribute indicating the primary fuel used in each power plant. We can create a style where each unique fuel type is shown in a different color. Select primary_fuel
as the Column. Click Classify. You will multiple categories appear and the map rendering change accordingly.Rule-based
renderer. Select all but one rules by holding the Ctrl
key and clicking on each row. Once selected, click the Remove selected rules button to delete them.Renewable fuel
as the Label. Click the Expression button next to Filter."primary_fuel" IN ('Biomass', 'Geothermal', 'Hydro', 'Solar', 'Wind', 'Storage', 'Wave and Tidal')
Note
The types of fuel chosen for renewable vs. non-renewable categories is based on Wikipedia. There are alternate definitions and classifications that may not match what is chosen here.
Non-renewable fuel
as the Label. Click the Expression button next to Filter."primary_fuel" IN ('Coal', 'Gas', 'Nuclear', 'Oil', 'Petcoke')
Other
as the Label. Choose Else - Catch all for other features instead of a Filter. This will ensure that any category missed in the previous 2 rules, will be styled by this rule. Scroll down and click Simple marker. Choose an appropriate Fill color. Once done, click the Back button.Renewable fuel
rule and select Change Size.log10
function. You can experiment with different expressions to arrive at what works best for your preferred visualization. Enter the following expression and click OK.log10("capacity_mw") + 1
This work is licensed under a Creative Commons Attribution 4.0 International License