Idraluna Archives

QGIS Hexmap Template & New Tutorial

I recently threw together a simple QGIS project for making basic hexmaps. It includes a pre-generated 6-mile hexgrid and preset symbology for common terrain types & landmark icons.

It's available on itch:

And on GitLab.

Many thanks to MTB & EvilTables for testing & feedback.

The instructions are in the GitLab README and on itch, but are also reproduced below:


This is a brief introduction to the QGIS hexcrawl template, hopefully adequate to start making basic hexmaps in QGIS. Links to more resources for learning QGIS are provided at the end.

1. Download & Install QGIS

Go to qgis.org/download and follow the instructions corresponding to your operating system.

2. Load the Project File

Load Make_your_own_hexmap.qgz. You should see the following in the Layers panel:

3. Assign Terrain

In the Map Canvas pane, you should see a field of grey hexes, with a sample hexflower in the right corner.

You can zoom in and out using the scroll wheel, and pan by clicking and holding the middle-mouse button.

To change the terrain type in a group of hexes, select Terrain (6mi) in the Layers panel, and click the yellow pencil button to turn on edit mode (1). Then click the Select Feature(s) button (2).

Then, click whichever hexes to which you want to assign a terrain type. (You can also drag a box to mass-select, or use the drop-down arrow next to Select Feature(s) to switch to lasso select). Selected hexes should appear in yellow.

To assign a hex type, click Modify The Features of All Selected Features Simultaneously (1). and type in the desired terrain type (2). Currently implemented terrain types are:

After deselecting (Ctrl-Alt-A), you should see the new terrain symbology appear. If not, make sure the name was spelled correctly (case-sensitive).

To make changes permanent, make sure to click the Save Layer Edits button. Not the same as the save project button.

To erase the sample hexflower, you can select all of its hexes and use Modify The Features of All Selected Features Simultaneously to delete the entries for Terrain, Name, POI_Icon, & Region.

4. Assign Points of Interest

To assign a point of interest, select a hex and bring up the Modify The Features of All Selected Features Simultaneously dialog. The two relevant fields this time are Name & POI_Icon. The former places a text label over the hex, and the latter controls what icon is placed over the hex.

After you save the layer, you should see the label and icon appear.

Currently, the following icon options are implemented:

To keep things light weight, all icons currently use native QGIS svg icons. If you'd like to substitute your own, right-click the Points of Interest layer, and open the Properties dialog. In the Symbology tab, double-click the icon in the Symbol column you want to change. Click SVG Marker, and use the browse box to select your preferred SVG icon.

5. Draw Roads & Rivers

Select the layer you want to draw and turn on edit mode. Click the Add Line Feature and then click on the map where you want to start drawing the road/river. Continue adding nodes until you are finished, then right click. A dialog will appear -- enter "Major", "Minor", or "Stream" for rivers or "Road", "Trail", or "Searoute" for roads. You can also add a name, if desired.

The project snapping settings currently 'snap' nodes to the vertices and center of each hex. I recommend drawing rivers along vertices and roads through hex centers, but you can technically place nodes for either layer anywhere.

Don't forget to delete the sample roads and rivers! To do so, select the segment you want to delete with edit mode on, and hit the delete button.

6. (Optional) Group Hexes into Regions

Similar to assigning terrain, select and edit a group of hexes, this time modifying the Region field. Save the layer edits.

Next, right-click on the Regions layer and navigate to the Symbology tab. Click Classify. You should see your region name appear in the list. Make sure it is checked. On the map, you should see your region outlined with a colored gradient. (Note: you may need to turn edit mode on and off for the Regions layer to update properly).

If you'd like to change the color, double-click on the swatch in the Symbology pane, and use the Color selector to pick a new color.

7. Make a Map Layout

When you're done assigning hexes, you may want to disable the extra grey hexes. To do so, expand the Terrain (6mi) layer in the Layers panel and uncheck the box without a legend entry.

To make a map layout, click the Layout Manager button.

You should see an existing layout called Sample_hexflower. I recommend duplicating this layout and modifying it to your needs.

When you open it, you should see a map layout similar to the sample hexflower, but depicting your modified map. The basics of the layout editor should be familiar if you have used other desktop publishing software -- you can add text boxes, shapes, & other elements, and drag, rotate, rescale them, etc.

You will probably need to zoom or recenter the map. This can be done using the Move Item Content tool on the left toolbar. For more precision, you can specify a scale and extent in the Item Properties pane when you have the map object selected.

You might also need to use a bigger page size to display hex labels with adequate resolution. To do so, right-click in the layout and select Page Properties, then specify new dimensions.

The provided legend lists every possible terrain and POI type. To delete unused entries, click the legend, then navigate to the Item Properties pane. Scroll down to the Legend Items section. You can select individual legend entries and use the red minus button to remove them from the legend.

You can also double-click on an entry to change its label. (You will almost certainly want to modify POI labels to refer to whatever location type they represent).

To change the font of any feature, look for the Fonts and Text Formatting section in its Item Properties pane.

Important: The legend symbols for POIs are manually overridden, so may not update properly if you substitute your own svg file. (This has to do with the parameters needed to display them at constant map scale). To correct this, double-click the symbol swatch to the left of the label (it might appear to be blank). Click the button under Custom Symbol and update the svg as you did before.

Making it Your Own

Since QGIS is designed to make (almost) any type of map, the possibilities for customization are immense.

Adding a New Hex Attribute

If you'd like to add another field for storing data about a hex (say, population, or faction), you can use the Fields tab in the layer's Properties menu. Put the layer into edit mode, then click the New Field button. Fields must have a specified data type (integer for population, text for faction).

Changing Label Fonts

All labels currently use Open Sans for the sake of simplicity. To use a different font, navigate to the Labels section of the Properties menu for a layer, and specify your preferred font.

You can also fully toggle labels on and off by right clicking a layer in the Layers pane and clicking Show Labels in the context menu.

Changing Symbology

QGIS offers an enormous variety of options for symbolizing features, too many to adequately detail here.

To change the color of a terrain type, open the Properties window for the Terrain layer, double-click the symbol you want to edit, and select a new color.

Some symbols are composite, so you'll need to select which sub-feature you want to edit. In the example below, Simple Fill instructs QGIS to fill all hexes where Terrain = 'Forest' with a light green. Centroid Fill tells QGIS to then place a dark green tree SVG icon on the center of the hexagon.

To add a new Terrain type, you can follow the same steps for adding a new symbology category in the Regions section above. You can right click the symbol swatch from a similar category and copy-paste it to your new category, then modify colors and icons to your liking.

Generating a New Grid

If you'd like to use a hex grid overlaid over a specific latitude or longitude, or one with larger or smaller hexes, you can use the Create Grid tool, saving the result as a new .gpkg layer (or shapefile, but I recommend against it). To port over the template styling, you can duplicate the new layer (so you have one version for terrain and one for POIs), then right-click a template layer and use Styles > Copy Style > All Style Categories to copy the symbology, then Styles > Paste Style > All Style Categories.

If you use a larger or smaller grid, you will need to manually adjust the display size of SVG icons. In the screenshot above (in the Changing Symbology section), note that the size is specified as 10,000 'meters at scale'. This ensures that the size of icons won't change as the map canvas is zoomed in & out. For 3 mile hexes, modify this field to 5,000, for 12 mile hexes to 20,000, etc.

More QGIS Resources