I have layer of buildings (polygons), and in attribute table contains number of buildings, floor area of buildings etc. I would like to know how many buildings (#) is per Ha or km2, and building area per Ha or km2.

How can I calculate that in QGIS3?

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq.
    – underdark
    May 3, 2019 at 19:12
  • 1
    Well believe me it is my last option to post a question. I have checked all the question related online spent hours trying different option etc, but does not give me the answer on what I need. I did not know I have to elaborate on that. I am also really new to qgis, and do not have any experience coding. SO I hope that answers your comment!
    – Julija M
    May 3, 2019 at 19:20

2 Answers 2


There are lots of methodologies for calculate building density. Here I describe the most simple one based on a regular grid:

  1. Create a grid with the width needed:

Vector > Research Tools > Create Grid

  1. Create a centroid of any polygon building:

Vector > Geometry Tools > Centroids

  1. Count points in polygon:

Vector > Analysis Tools > Count points in polygons

Hope it helps


It seems you have a Geography problem rather than about QGIS.

Any density measure is taken considering a relevant area unit, such as neighborhood, city limit, or census tract. As you have not included any, it is not possible to calculate any kind of density with QGIS or other GIS software.

Once you have another spatial layer in your project, you may use Vector Analysis > Count points in polygon to get the number of buildings within a given neighborhood.

Other measures, such as total buildup area per neighborhood are possible with the Vector Analysis comands.

Please let me know if this helps you in any way.

Good luck

  • Thank you for the answer, but I do not have data on the city limit or any other in that matter. I was just hoping there is a way to use the data I have in qgis and create a layer and column in attribute table using a command that I was not aware of and to preform the needed calculations.
    – Julija M
    May 3, 2019 at 20:03
  • Hi again @Alexandre Pereira, I have now municipality border layer and a buildings shapefiles layer, can you let me know how to find the density of building area in the municipality? I did not found a option to calculate density in vector analysis commands, only to count the points. Thank you
    – Julija M
    Jul 27, 2019 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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