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?
1 Answer
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. Commented 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.– MattCommented Aug 5, 2022 at 12:56