1

I'm using QGIS. I'd like to change the size of my symbols according to a specific numeric value but, unlike the "Graduated" symbol, merging the same near-by value.

For example: in the same area I've got 3 points (almost overlapping), one with a "quantity" value of 2, the others 3. So the merged "quantity" value would be (2+3+3) 8. I'd like the symbol size to change according to this calculated value.

2

1 Answer 1

2

I recommend saving a copy of your points layer, because overlay_nearest is buggy when used on the current layer.

Then you can use this expression (on the layer points2) to sum the values of the points (in layer points1) within a search radius (1000 m in my case)

array_sum(
    overlay_nearest(
        layer:='points1',      -- the original points layer
        expression:=value,     -- the field you want to sum
        limit:=-1,             -- limit -1 returns all available features 
        max_distance:=1000)    -- search radius
    )

I called the field weighted_value and set the symbol size to this field.

enter image description here

1
  • Thanks a lot, perfect!
    – DavideIT82
    Mar 22, 2022 at 18:09

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.