QGIS How To Create Hexagon Grid Based on Selangor State Boundary

QGIS Hexagon Grid

GIS hexagon grid can be created using QGIS. In this case I’m using QGIS version 2.18.15.

First of all, you must have a boundary layer. I’m using Selangor parliamentary boundary.

QGIS Selangor Parliamentary Boundary
QGIS Selangor Parliamentary Boundary

Steps to Create Hexagon Grid

1) Enable the Processing Toolbox

View -> Panel -> Toolbox

QGIS Enable Toolbox
QGIS Enable Toolbox

2) From the Processing Toolbox, select Create Grid

QGIS Processing Toolbox
QGIS Processing Toolbox

3) After setting the configuration as follows, click run:

  • Grid type: Hexagon
  • Grid extent:  Select canvas and choose Selangor boundary or your boundary layer.
  • QGIS Use Extent Selangor Parliamentary
    QGIS Use Extent Selangor Parliamentary
  • Horizontal / Vertical spacing: 0.025 (means 0.025km)
  • Grid CRS: EPSG 4326 (or popularly known as WGS 84 where Google Map use this CRS)
QGIS Hexagon Grid Processing
QGIS Hexagon Grid Processing

4) After click Run, a hexagon grid layer will appear as follows:

QGIS Hexagon Grid Layer
QGIS Hexagon Grid Layer

5) Select Vector -> Research Tools -> Select by Location

QGIS Select By Location
QGIS Select By Location

6) Input the Configuratoin for Select by Location as follows, then click Run:

  • Layer to select: Your Hexagon Grid Layer
  • Additional layer (intersection layer): Your boundary layer in my case Selangor parliamentary
  • Geometric predicate: choose intersects, contains, touches, overlaps
QGIS Select By Location Configuration
QGIS Select By Location Configuration

7)Then click Select Features using an expression -> Invert Feature Selection

QGIS Invert Feature Selection
QGIS Invert Feature Selection

8)After inversion, your hexagon grid would look like below:

QGIS After inversion
QGIS After inversion

9) Click Toggle Editing (pencil icon) then Delete (trash icon)

QGIS Toggle Editing & Trash
QGIS Toggle Editing & Trash

10) Final output would look like this

QGIS Hexagon Grid
QGIS Hexagon Grid