I am attempting to produce a density map by aggregating points over a hexagonal grid using a processing model as in a tutorial by Ujaval Gandhi (http://www.qgistutorials.com/en/docs/3/processing_graphical_modeler.html).

One problem that I am having is that when I am generating my grid the resulting hexbins are not covering all of my point data. I thought it must be a layer extent problem so I checked my base layer (polygon) extent and so it was, hexbins were only showing within the extent of the layer. So then I opted for my point layer instead and it seems to have improved, although I'm still missing hexbins in the north and west, indicated by the black symbols on the map below like so:

Graphic modeler hexbin generation missing points

I wanted to test this manually by creating a grid outside of graphic modeler to see why this was happening.

Create grid -> Grid extent (Use layer extent of the point shapefile) -> Horizontal & Vertical spacing (500 m). This is the result:

Create grid manually using layer extent of point layer

I don't understand why hexbins are not including the outermost coordinates from my point shapefile! What am I doing wrong? I would like to keep it within model processing and not have to repeat the process manually by creating grids each time.

All layers and project CRS are in WGS 84 / UTM zone 38S. Data are catch locations of fishes caught around an atoll.

1 Answer 1


Add a buffer around the extent of your point layer to really cover all points with the hexagon grid.

The very shape of hexagons leads to the fact that not every column reaches up to the max. extent. There are empty spaces (half-hexagons) in the top line. I created the grind in the screenshot with the extent of the red points. Than I added a point to the same layer (where the blue point is): the max. extent does not change, so if you now create a grid, you'll get the exactly same result.

Screenshot: the blue point is inside the maximum extent, but not covered by the hex-grid: enter image description here

Screenshot 2: point layer (red dots), original grid (yellow), buffer (blue outline) around the extent of the point layer with a distance of half the grid-size. Create a grid based on the extent of this buffer (red hexagons). You see now that the blue point (upper left) is included:

enter image description here

  • Thank you for the response! Ok... so if I am following right, with my point layer I would generate a layer extent (Vector -> Research Tools -> Extract Layer Extent) then with that new shapefile I would then generate a buffer (Vector -> Geoprocessing Tools -> Buffer -> Set the distance to half the hexagon size i.e. 250 metres) then with the buffered layer I create the hexbins from?
    – Tuna-92
    Commented Jun 30, 2021 at 19:35
  • Yes, 100% correct!
    – Babel
    Commented Jun 30, 2021 at 19:36
  • Awesome, thanks for the help. Do you have any sources of info about hexbins? this is my first time really exploring them, I would like to know more about their application. For example, the hexagon positions in your second screenshot have moved so that must influence the number of points within each hexbin? I also would ultimately like the hexagons not to include landmass and know more about their positioning.
    – Tuna-92
    Commented Jun 30, 2021 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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