Thursday 21 January 2016

buffer - QGIS creating a heatmap


This is my first question here. I have used the forum extensively in the past and it has been an incredibly useful resource, but this time I am stuck with an issue I cannot resolve. Here is a brief description. I have a map showing:



  • postal code polygons (in light yellow in the example)

  • another layer shows a few much bigger polygons (let's call them urban areas, in grey in the example) which intersect with the postal code polygons

  • a layer showing points across the map (red stars in the example)



I then create 3km buffer circles around the points from the third layer. Now, here is what i would like to do:



  • when a postal code polygon intersects with a buffer circle AND an urban area polygons, I would like to associate the value 1 with that postal code polygon (if it intersects with two circles AND an urban area than the value would be 1+1=2)

  • finally, I would like to create a heatmap with the postal code polygons based on these values


I'm using QGIS 2.16.3. Please let me know if anything is unclear and I will clarify.


See this extract as example where i added some of the values i would like to see returned, thinking that this would be the best way to build the heatmap in the final step, but if i'm going down the wrong path, let me know.


Imgur



Answer




Image really helped cheers.



  1. Identify the postcodes in the urban area. 'Vector > Select by location'. Use this to select all your postcode polygons that intersect the urban area. Save the selected polygons out and I'll refer to this product layer as urban_pc.

  2. Relate buffer zones to postcodes. Use 'Vector > Intersect' to intersect the buffers by urban_pc. The product should be similar to the buffer layer, except now cut up into tiny postcode segments. I'll call this product int_buff.

  3. Time to count. 'Vector > Geometry Tools > Polygon centroids' to extract the centroids from your int_buff layer. These centroids will be a count of the number of buffers that fall within the postcode. Next use 'Processing > Toolbox > (search) Count points in polygon' and with your urban_pc as the polygon layer and centroids as your point layer, the product will be a new urban_pc layer with a new column, counting the points that fall within each postcode. I shall this product count_pc

  4. Finish off. 'Vector > Polygon centroids' on count_pc and you will end with a finished point layer product of postcode centroids that fall within an urban area and how many buffers they intersect.


Now to create the heatmap, either through the style properties, or something more permanent 'Raster > Heatmap > Heatmap' to create a new layer.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...