2

I would like to make a heat map of "building density" based on the area of the building footprints (I have them in a geojson as polygons) in relation to their "non-building" surroundings based on fixed grid (or alternative). So in other words put a grid over the map 100x100m and in each grid sector look at the area relatioship between the building footprint and the surrounding footprint. The more building the denser.

How would I best go about this? Are there better ways to do area based heatmaps? I have calculated centroids for each building and made heat maps with that but I need something based on area not topology.

1

One approach is to convert your polygons to binary raster and calculate the percent building cover within a moving (focal) window for each pixel. Here is how:

  1. Convert the vector polygon building footprints to binary raster where building = 1, else 0.

    Raster > Conversion > Rasterize (Vector to Raster)

enter image description here

  1. Run a moving window using some areal unit that is meaningful (e.g. 100m^2, acres, miles^2, etc.) with a mean statistic to calculate percent building cover per unit area.

    Processing Toolbox > GRASS > Raster > r.neighbors

enter image description here

2
  • 1
    Thank you so much, this is perfect! – kermitt Sep 2 '20 at 16:13
  • 1
    This worked nicely. For anyone experiencing issues with step 1: make sure your vector layer has the same projection set as the crs in the project properties. I exported the layer with the right projection and reinserted it. This resolved any issues. (changing the projection settings in the layer did not). – kermitt Sep 2 '20 at 17:51

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.