<div dir="ltr">I want to share a new vector based density analysis plugin sooner rather than later. My work priorities are being rearranged so that I will not be able to do new development or new features, but only fix bugs if they arise. Here is the new plugin. Please test it out and give me any feedback. I have about a month where I can optimize it more, but after that I will not be able to do further development.<div><br></div><div><a href="https://plugins.qgis.org/plugins/densityanalysis/" target="_blank">https://plugins.qgis.org/plugins/densityanalysis/</a><br></div><div><br></div><div>You can read the <a href="https://github.com/NationalSecurityAgency/qgis-densityanalysis-plugin/#readme" target="_blank">Density Analyses Documentation</a>, but here are the highlights.</div><div><br></div><div>This plugin currently has 3 vector based density algorithms:</div><div><ol><li><b>Create density map grid</b> - This one creates a grid of polygons and counts the number of points in those polygons using the QGIS <b><i>Create grid</i></b> processing algorithm followed by the <b><i>Count points in polygon</i></b> and then styled appropriately. It is very important that the input point data be spatially indexed. This algorithm provides the most flexibility, but <i><b>Count points in </b><b>polygon</b></i> is time consuming.</li><li><b>Create geohash density map</b> - This makes use of the geohash algorithm to geohash each point and count the number of points for each geohash and create the geohash polygons. Depending on the density of the map this can be an order of magnitude faster than the above algorithm. The disadvantage is that you are limited to the geohash grid resolutions.</li><li><b>Create H3 density map</b> - This is the fastest of all 3 algorithms. It creates a hexagon density map grid and is similar in that it uses a H3 geohash index to count all the points in each geohash. Unfortunately, H3 is not a part of the QGIS standard python libraries and you will need to 'pip install h3' to be able to access these algorithms, but it will be worth it. QGIS developers, you may want to consider including H3 as a part of QGIS.</li></ol><div>Here are some running times of the 3 algorithms with a data set of around 194,000 points.</div></div><div><ul><li>Create density map grid - 63.18 seconds</li><li>Create geohash density map - 5.6 seconds</li><li>Create H3 density map - 3.7 seconds</li></ul><div>Once the heatmaps are created (note that they are automatically styled), then there is a heatmap explorer that allows you to load in the N highest grid counts and by clicking on them it will pan or zoom to the heatmap polygon to examine the data that is there.</div></div><div><br></div><div>There are also 3 other utilities.</div><div><ol><li><b>Apply style to selected layers</b> - You can copy a style to the clipboard or select a .qml file and apply it to all selected layers or groups of layers.</li><li><b>Apply graduated style</b> - This applies a graduated style to a layer, but it is done as a processing algorithm so it can be used in the model builder.</li><li><b>Apply random categorized style</b> - This applies a random categorized style to a layer, but it is done as a processing algorithm so it can be used in the model builder.</li></ol><div>I plan on also adding a raster based polygon density algorithm that seems to be missing from QGIS.</div></div><div><br></div><div>If you have any suggestions or find any problems with the plugin please let me know.</div><div><br></div><div>Thanks,</div><div><br></div><div>C. Hamilton</div></div>