Creating a heat map
A heat map is used to show the geographic clustering of data using a raster image that shows density. The clustering can also be weighed using a field in the data to not only show geographic density but also an intensity factor. In this recipe, we'll use earthquake point data to create a heat map of the impact of an earthquake and weigh the clustering by the earthquake's magnitude.
Getting ready
This recipe requires no preparation; however, make sure your installation of QGIS includes SAGA. For more information, see the Installing QGIS for development recipe from Chapter 1, Automating QGIS.
How to do it...
We will build a map with a worldwide base layer of countries and earthquake locations, both in GeoJSON. Next, we'll run the SAGA kernel density estimation algorithm to produce the heat map image. We'll create a layer from the output, add a color shader to it, and add it to the map. To do this, we need to perform the following steps:
- First...