Road Atlas style grids in QGIS

Have you ever used a Road Atlas, or the London A-Z, and wondered how to get the same in QGIS?

I've just submitted a new QGIS plugin called 'Create Grid for Indexing'. It's very similar to "create vector grid", but it adds names to each cell, in a spreadsheet-sort-of-way :)

Update: This can now be found in the plugin manager, under 'Create Indexed Vector Grid'
__withlabels.png

Note : this plugin creates memory-based layers. They will be lost when you shutdown QGIS. You need to remember to save them (right click layer, save as...) before you close.

You choose the extent you want - either the currently selected layer, or the map canvas extent.

Next, choose the type. You can go with rectangular - this splits the area into a whole number of cells vertically and horizontally.

Screenshot from 2015-09-28 23:09:39.png

Or, you can choose square, and decide whether to go for a whole number of columns or a whole number of rows.

You can also choose "Square - choose best fit". This will find the number of rows and columns which comes closest to being square, even if your extent is rectangular. It tends to make the grid cells quite small, though.

Use the spin boxes to choose the number of rows and/or columns. The button updates to show you the cell size and aspect ratio.

You can also choose whether or not to extend the grid with label cells. These appear above the extent (for columns) or to the left (for rows).

Each cell (and label cell, if you opted for this) gets four fields added.

  • name : full name of the cell (e.g. "A1" for grid cell, "A" or "1" for label cells)
  • isLabel : set to 'Y' if a label, or 'N'
  • row : set to name of row (grid cells and row labels only)
  • col : set to name of column (grid cells and column labels only)

You can use these in symbology to change the appearance of cells, and in labelling them, like so...

__exactcolumns.png

Note that if the grid doesn't appear as expected, you may need to set the layer CRS manually on the generated layer.

Code is available on Github.