I have a dataset that consists of the 125x125m grid with population count and time travel vector layers (for example, 5, 10, 15 mins by car). I'd like to mark every grid that's within the buffer range (or sum up total population for every buffer?). I used selecting by location (for every buffer separately), extracting and summing it up and then copying the totalto the buffer layer, but are there faster methods to do that? My method isn't the most efficient

I made a small reproducible example, if that helps - Link

1 Answer 1

  1. Activate the "buffers" layer

  2. Click on field calculator

  3. Mark "new field", set a valid name for it, select "whole number"

  4. Copy this code in the window:

    aggregate('gridd', 'sum', "pop_tot", filter:=intersects( $geometry, geometry(@parent)))

  5. Click "OK"

As far as I know, it works.

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.