I have a number of points on a map, each with a numeric attribute taking values from 1-9. The points with attribute equal 1 should have the highest density representation, and the points with attribute equal to 9 should have the lowest.

Heat maps in QGIS rely on the density of points in an area having a higher density, but I am trying to calculate it based on that numeric attribute, even if the points are further apart.

I tried using IDW interpolation and TIN interpolation (with distance coefficient = 1), but both produced a black layer as output. I was expecting to see 9 different colors scattered across the map instead. Is there another way to represent what I want?

I'm essentially assigning point vertices representing streets values from 1-9, 1 being the most suitable to walk, and 9 being the most unsafe. I'm just trying to visually show those results on the map.

1 Answer 1


The principle idea is to add vertices at a constant distance to the line. You can then use these vertices for the heatmap as they have everywhere the same distance between them. Like this, point density is equal everywhere and does not influence the rendering of the heatmap - colors will thus represent attribute values primarily, not density.

  1. On your line layer, apply Densify by interval and set a distance so that each segment gets enough points - if using roads, 10 meters would be a good value to start.

  2. Extract the vertices from the densified lines.

  3. Now set layer rendering style to Heatmap and for Weight points by use the field that contains your values from 1-9. If you want the highest value for 1, use 1/value (see screenshot). Manually tweak the other settings (radius, maximum value) until you have an image that suits your needs. In the color ramp, set the leftmost color to transparent to see the background map (if you have any).

Similarily, you can also create an actual raster layer with one of the interpolation tools.

Screenshot: the smaller the number, the darker the line. The labels come from the line layer (symbology of lines set to No Symbols): enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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