[GIS] Heatmap using Kernel density estimation

heat mapkernel densityqgis

I have been trying to generate heatmap using kernel density estimation from python console in QGIS.

This is command i'm using:

processing.runandload("saga:kerneldensityestimation", "D:/test/Towns.shp", "A_RAIN_MM", radius, 0, "0,1,0,1", 0.00848754, "D:/test/raster.tif")

The result I'm getting is a image with black shade which is totally different from the heatmap i generated using QGIS user interface.

After googling, I found this link:
kernel density estimation. This contains the list of parameters which kernel density estimation takes, but it does not contains any description about the parameters. What these parameters are i do not know. Can i anyone tell me what i'm doing wrong? Or is there another way of generating heatmap?

Best Answer

I think you need to replace your radius parameter with a number.

Incase this might help for future reference, what I usually do when I need to know what parameters I have to set, is to check the "help" details of the algorithm within Python Console (Plugins > Python Console). Type the first 2 lines below:

>>>import processing
>>>processing.alghelp("saga:kerneldensityestimation")

ALGORITHM: Kernel density estimation
        POINTS <ParameterVector>
        POPULATION <ParameterTableField from POINTS>
        RADIUS <ParameterNumber>
        KERNEL <ParameterSelection>
        TARGET <ParameterSelection>
        OUTPUT_EXTENT <ParameterExtent>
        USER_SIZE <ParameterNumber>
        USER_GRID <OutputRaster>

KERNEL(Kernel)
        0 - [0] quartic kernel
        1 - [1] gaussian kernel
TARGET(Target Grid)
        0 - [0] user defined
Related Question