1

Is there a best practice in QGIS for summarizing point data in small cells over a large area?

Background/Problem: In QGIS, it is "possible" to create a grid of hex cells over an area using the extent of a layer. Then one can summarize the points which fall in that polygon grid. However this is very computationally wasteful to construct for points that cover a large extent, but which need to be analyzed in relatively small cells. For example, if points that cover an entire region need to be binned at a 100-500M resolution - this will leave the user waiting for hours while QGIS constructs the grid, then a while longer for it to do the summary stats.

In ArcGIS Pro, I can [mis]use the Optimized Outlier Analysis tool, which allows me to determine the grid type, size and distance band, ignoring other stats and returning only polygons drawn and populated with the counts of the points. This gives me the same sort of output (summarized hex cells) but at a tiny fraction of the time.

Is there a workflow/plugin in QGIS that will get me to a similar output?

I have tried the Hotspot Analysis plugin in QGIS, but A.) it appears abandoned and B.) it requires statistics fields as forced, not optional, and C.) pysal is tricky to get working correctly with QGIS on Windows.

UPDATE: Description of the Outlier Analysis Tool as requested, from the documentation:

Optimized Outlier Analysis executes the Cluster and Outlier Analysis (Anselin Local Moran's I) tool using parameters derived from characteristics of your input data. Similar to the way that the automatic setting on a digital camera will use lighting and subject versus ground readings to determine an appropriate aperture, shutter speed, and focus, the Optimized Outlier Analysis tool interrogates your data to obtain the settings that will yield optimal analysis results. If, for example, the Input Features dataset contains incident point data, the tool will aggregate the incidents into weighted features. Using the distribution of the weighted features, the tool will identify an appropriate scale of analysis. The classification type reported in the Output Features will be automatically adjusted for multiple testing and spatial dependence using the False Discovery Rate (FDR) correction method.

3
  • do they have to be hexagons? a small square grid would be quicker to produce. Also can you add some details of what "Optimised Outlier Analysis tool" does for those of us without an ArcGIS Pro licence.
    – Ian Turton
    Apr 10 '21 at 10:34
  • Hexagons work well to bin point content that is imprecise in unpredictable or ambiguous ways. Squares could work; there is still the waste of constructing cells on a “by extent” method vs a clustering algorithm though. Also updated the question with the tool description.
    – auslander
    Apr 11 '21 at 13:43
  • You could first create a simple square grid and identify which cells contain points. Then create a hexagon grid only for the cells that contain points.
    – Babel
    Sep 23 '21 at 9:24
1

I think that one possibility is to use QGIS to call PostGIS's ST_HexagonGrid function to generate the hexagon grid, and then use ST_Intersects as the predicate to perform a spatial join between the points and the hexagons. Then you can use count() or another aggregate function with a GROUP BY on the ID field of the hexagon layer.

This is assuming that you use SQL via its DBManager plugin.

1
  • Will this work against a GeoPackage? I don't have a PG instance.
    – auslander
    Apr 9 '21 at 21:00

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.