6

I made a heatmap from points (with values) in QGIS, and now try to understand what the values in color scale are.

  1. Radius 300 map units (meters)
  2. Pixel size 10 map units (meters)
  3. Point values are 10-100.

In heatmap options, I see the kernel function is uniform.

Result values are 0-0.04 . How are they calculated? I want to recalculate it to some real life scales, sum(values)/area.

A test sample: same parameters (radius 300 meters, pixel 10 meters). All points fall within radius, their sum is 152. The result values are 0-0.04. I don't get where .04 came from.

Test calculation. If I assume radius in heatmap pixels, it's 30 px, then

In [8]: 152. / (30 ** 2 * math.pi)
Out[8]: 0.05375900299992909

What is 0.04 then?

enter image description here enter image description here

8

Found the answer myself. Check pixel size of raster, then calculate:

 sum(point.value for point in circle) / (radius * radius * pi)

Where radius is in pixels (radius / pixel size), and value is what it should be (if all points are in radius, then sum, if only one, then that point value). Select "info tool" (top left on the screenshot), click on respective pixel and see the values are correct.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.