Adding a North arrow to the map

North arrows are another common cartographic element, found even in ancient maps, which show the orientation of the map relative to either true, grid, or magnetic north. Sometimes, these symbols can be quite elaborate. However, QGIS provides a basic line arrow element that we will use in combination with a map label to make a basic North arrow.

Getting ready

You will need to download the following zipped shapefile and extract it to your qgis_data directory in a subdirectory named ms:

https://github.com/GeospatialPython/Learn/raw/master/Mississippi.zip

In addition to the shapefile, you will also need the MapComposer class, to simplify the code needed to add this one element. If you haven't already used it in a previous ...

Get QGIS Python Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.