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 recipe, you can download it from https://github.com/GeospatialPython/Learn/raw/master/MapComposer.py.
This file must be accessible from the QGIS Python console; for this, you need to ensure that it is in the Python path directory. Place the...