I want to count the amount of buildings within my neighbourhoods. The dissolve function doesn't work here because the buildings are not intersecting. Does someone have a tip on how I can do this?

enter image description here

1 Answer 1


Step 1: Make sure your buildings have an ID.

Step 2: Join attributes by location in order to get the name/ID of your neighbourhoods to your buildings.

Step 3: Run count("building ID",group_by:="neighbourhood ID") in the field calculator on the joined layer. Column names have to be replaced by the one your data has.

  • How can I quickly give the buildings an ID? The building layer does not have information yet in which neighbourhood it is in. Aug 5, 2022 at 9:24
  • Your building layer looks like it comes from a cadastral dataset or from OpenStreetMap so I would imagine that each feature already has a unique identifier. Check the attribute table.
    – Matt
    Aug 5, 2022 at 12:56

Your Answer

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

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