Wednesday, September 12, 2012

How to Create and Print Custom Canadian Topographic Maps with Quantum GIS

rev20120917a

This post describes how to create and print customized Canadian Topographic (topo) maps using free digital topographic map information made available on the Internet by the Government of Canada (NRCan) and the free Quantum GIS (QGIS) computer application. QGIS can also be used to create maps from other free or commercial digital map information such as Open Street Map or US nautical charts (Canadian digital nautical charts are available but not free) but that is not covered in here.

QGIS is free Geographic Information System (GIS) software that runs on Windows, MacOS and Linux. Because QGIS will seamlessly join map files and has a Print Composer that enables map scale, area displayed and rotation angle to be specified, custom maps can be created containing just the area of interest without regard for standard topo map sheet boundaries or orientation. This is very useful when a large format plotter isn’t available to print full size map sheets as just the area of interest can be printed on standard letter or legal paper sizes using a normal home or office printer. It also facilitates the production of coastal or trail strip maps showing just the immediate area around the coastline or trail for kayaking or hiking.

For maps files to be seamlessly joined, they must be georeferenced and have no collars (borders). Paper topo maps can be scanned and then edited to eliminate collars and georeferenced with some effort, but NRCan has made it easy by providing the freely downloadable Toporama 1:50,000 raster map series. The Toporama map files are indexed by the National Topographic System grid, are already georeferenced (GeoTIFF or GeoPDF), collarless, have no grid overlay, and are available in either UTM or Lat/Long projections. For kayaking and hiking purposes, the UTM projection would generally be the best choice as a 1 km UTM grid, which is very useful for navigation, can easily be overlaid on the map. The Toporama maps are based on the most recent NRCan CanVec vector topographic information database and a new edition is released twice a year so they are about as up to date as Canadian Gov't topo maps can be.

NRCan also provide a publicly available Toporama Web Map Service (WMS) on the Internet. QGIS can load any required Canadian Topographic map data from the Toporama WMS directly. The advantage is that topo maps for any area in Canada can be directly accessed via QGIS without needing to identify, download and store local GeoTIFF map files on the QGIS workstation. Also, the map layers are individually accessible in case that is of value. The disadvantage is that high speed Internet access is required while working in QGIS and accessing the WMS is slower than using local map files. The Toporama WMS can supply many projections but UTM would generally be the best choice for kayaking and hiking.

The WMS and downloadable map files appear to use different styles so there may be a preference for one or the other. At the current time, several of the Toporama WMS layers, including the Feature Names layer are not scaled correctly for larger scale maps (like 1:50,000) so their text or content is too large and obscures other map features. This is not the case with the downloadable Toporama map files which appear to have all features properly scaled for 1:50000.  It is possible to use both map files and the WMS at the same time as long as the file layer is in front of the WMS layer, this could be useful to fill in around the edges of a map file without going to the effort of downloading adjacent maps.

Assuming a PC and Internet connection are available, Canadian topo maps can be created with no cost other than some time and effort, unless paper maps are required. If paper maps are required, an available printer can be used with any associated paper and ink or toner costs; or PDF maps can be created and sent to a commercial printing service such as Staples Copy & Print Centre. Because topo maps are intended to be viewed in colour, map features on monochrome printouts can be difficult to distinguish so colour printing is very desirable.

This post was initially inspired by the instructions in section 8 of the UBC VOC Online mapping page.  I have been interested in producing my own coastal strip maps for sea kayaking for many years, but until I recently ran across the UBC VOC page, had not found a feasible and inexpensive way to do so.

I am not a mapping, GIS or QGIS expert so please comment on this post to correct any errors or suggest better ways to do things.


Install the current QGIS version (1.8.0 at the time this was written)
  • Download the current version for your OS from http://download.qgis.org/
  • Install QGIS.  For Windows, run the downloaded installer; for Mac, click here and follow the instructions; for Linux, follow the instructions on the download page.

Loading Toporama UTM 1:50000 GeoTIFF Maps into QGIS

Loading Maps from the Toporama WMS into QGIS
  • Map information is downloaded on the fly via the Internet, map files aren’t required
  • A description of the Toporama WMS and each of its layers can be found at: http://geogratis.cgdi.gc.ca/geogratis/en/service/toporama.html
  • Open Quantum GIS Desktop
  • Settings -> Project properties - CRS (set the default CRS for this project)
  • Select Enable 'on the fly' CRS transformation
  • Set the CRS. For most of Nova Scotia the CRS should be NAD83 / UTM zone 20N if printing Topo type maps
  • Layer -> Add WMS Layer, or click the toolbar button
  • (If Toporama WMS not defined) Layers tab -> New
  • (If Toporama WMS not defined) Set Name to Toporama,
    set URL to http://wms.ess-ws.nrcan.gc.ca/wms/toporama_en, click OK
  • Ensure the Toporama WMS is selected
  • Click Connect
  • Select 0 WMS-Toporama for all layers, or expand the second item +1 Toporama to select one or more specific layers. The WMS will respond much more quickly if all the required layers are selected at once as one QGIS layer rather than individually as separate QGIS layers. Separate layers allow rendering order to be controlled (determine which layers are on top).
  • Set Image encoding to PNG24, the layer will be larger and download more slowly than if JPEG were selected but should be better quality for printing
  • Click Add
  • If selecting multiple separate layers for QGIS, select the next layer or layers, ensure the CRS is correct (there seems to be a bug and QGIS may hang if this isn’t correct), click Add and repeat as required. In the current QGIS release (1.8.0), to keep the CRS when adding multiple separate layers, select the new layer(s) before unselecting the previous layer(s).
  • Click Close when finished adding Toporama WMS layers
  • (Optional) In the Layers panel, if multiple layers were added and they are to be re-ordered, drag the layers into the required rendering order
  • File -> Save Project As...
  • Give the project a name and select the project file location
  • File -> New Print Composer, or click the toolbar button

(Optional) Loading a GPS track (*.gpx) into QGIS
  • In the Layers panel on the right side of the QGIS screen, select one of the map layers added above
  • Layer -> Set Project CRS from Layer, set the project CRS the same as the selected map layer
  • Settings -> Project properties -> Coordinate Reference System (CRS)
  • Select Enable 'on the fly' CRS transformation
  • Under Recently used coordinate reference systems, verify that the highlighted CRS matches the loaded map layers. For most of Nova Scotia the CRS should be NAD83 / UTM zone 20N.
  • Vector -> GPS -> GPS Tools -> Load GPX file
  • Browse to the *.gpx file containing the required GPS track and open it
  • Set the required Feature types (Tracks at least)
  • A layer for the GPS track should now be present on the map
  • In the Layers panel on the right side of the QGIS screen, select the GPS track layer added above
  • Layer -> Properties... -> Style
  • Set the track colour, symbol, etc. as required
  • (Optional) In the Layers panel, clear the X from the selection box to the left of the GPS track layer to prevent it from displaying and printing

Creating the printable map in QGIS Print Composer
  • A QGIS Project can have multiple Print Composers defined. In most cases, a separate one would probably be defined for each map page to be printed. Also, a Print Composer can have more than one map defined so an inset overview map could be added to a sheet or a single sheet could have multiple small maps on it, etc.
  • In the QGIS Print Composer window (not the Quantum GIS window)
  • Composition -> Paper and quality (panel on the right side of the Print Composer screen)
  • Set the paper format (Legal, ANSI A or ANSI B) and orientation (Landscape or Portrait)
  • Note the Width and Height shown for the selected paper size
  • Select Print as Raster at 300 dpi (this seems to work better for printing the grid and makes the exported PDF smaller)
  • Layout -> Add Map, or click the Toolbar button
  • Use the mouse to draw a rectangle. This area will display the map currently loaded into QGIS
  • Item Properties -> Map (on the right side of the Print Composer screen)
  • Set the Width and Height to that of the paper (from above) less about 6 mm in each dimension because laser printers can't print to the edge of a page
  • Set the Scale to 1:50000 or whatever scale is required
  • Use the mouse to centre the map on the page (drag)
  • View -> Zoom Full, or click the Toolbar button
  • Layout -> Move Content, or click the Toolbar button
  • Use the mouse to Pan (drag) and Zoom (mouse wheel) the map to the area of interest
  • Layout -> Move Item, or click the Toolbar button (this is required for selection in addition to move)
  • Click on the map to select it
  • Item Properties -> Map, set the Rotation (in degrees) to maximize the coastline shown on the page. Start by estimating the required rotation and adjust as required.
  • Re-adjust the area of interest that is displayed as required
  • Item Properties -> General options (below the Map, Extents and Grid sections)
  • (Optional) Unselect Show Frame to eliminate the map frame

To add a 1 km UTM grid on the printed map
  • Layout -> Move Item, or click the Toolbar button (this is required for selection in addition to move)
  • Click on the map to select it
  • Item Properties -> Grid (below Map and Extents sections)
  • Enable Show Grid
  • Set Interval X and Interval Y to 1000 (for a 1km grid)
  • Set Line color to a medium gray (too light and it won't be legible, too dark and it will be distracting)
  • (Optional) Enable Draw annotation to print the UTM grid coordinates on the edge of the map
  • Set Annotation position to Inside frame or as required
  • Set Annotation direction to Boundary direction
  • Set Font… -> Size to 4 or whatever size is required
  • Set Coordinate precision to 0.

To add a Scalebar
  • Layout -> Add Scalebar, or click the Toolbar button
  • Click the map to add the scale bar
  • Click on the scale bar to select it
  • Item Properties -> General options (below the Scale bar section)
  • Slide the Opacity slider all the way to the left to make it transparent
  • Unselect Show Frame to eliminate the frame
  • Item Properties -> Scale bar
  • Set Segment size and Map units per bar to 1000 (for a 1 km scale)
  • Set the Style, Left and Right segments, Height, etc. so that the scalebar has the desired appearance
  • Set Unit label to km
  • Set Font… -> Size as required
  • Use the mouse to drag the scalebar to the desired location on the map and size it as required

To add map scale text (e.g. 1:50000)
  • Layout -> Add Scalebar, or click the Toolbar button
  • Click the map to add the scale bar
  • Click on the scale bar to select it
  • Item Properties -> General options (below the Scale bar section)
  • Slide the Opacity slider all the way to the left to make it transparent
  • Unselect Show Frame to eliminate the frame
  • Item Properties -> Scale bar
  • Set the Style to Numeric
  • Set Font… -> Size as required
  • Use the mouse to drag the scale text to the desired location on the map and size it as required

To add a North Arrow
  • Layout -> Add Image, or click the Toolbar button
  • Click the map to add an image placeholder
  • Click on the image placeholder to select it
  • Item Properties -> General options
  • Slide the Opacity slider all the way to the left to make it transparent
  • Unselect Show Frame to eliminate the frame
  • Item Properties -> Picture options
  • Select the North Arrow image you like from the images shown
  • Select Sync with map to cause the North Arrow to align with the map regardless of map rotation
  • Use the mouse to drag the North Arrow to the desired location on the map and size it as required

To add a Map Title or other text
  • Layout -> Add Label, or click the Toolbar button
  • Click the map to add a Label placeholder
  • Click on the Label placeholder to select it
  • Item Properties -> General options
  • Slide the Opacity slider all the way to the left to make it transparent
  • Unselect Show Frame to eliminate the frame
  • Item Properties -> Label
  • Enter the required text
  • Set the Font… -> Size, Font colour… and Alignment as required
  • Use the mouse to drag the Label to the desired location on the map and size it as required

To add Magnetic Declination information on the map
  • In the main Quantum GIS window (not the QGIS Print Composer)
  • (If not already present) View -> Panels -> select Coordinate Capture to display the Coordinate Capture panel on the right side of the QGIS screen
  • (If the Coordinate Capture Panel is not listed) Plugins -> Manage Plugins… -> enable the Coordinate Capture plugin, then perform the previous step again
  • View -> Pan map, or click the Toolbar button
  • Use the mouse to pan the map so the center of the area to be printed is showing
  • In the Coordinate Capture panel
  • Click Start capture
  • Click on the centre of the area to be printed, the Coordinate Capture panel should now display the Longitude, Latitude and Easting, Northing (UTM) coordinates for the centre of the map. The more common coordinate order is Latitude, Longitude and Northing so depending on what they are being used for, the coordinate order may need to be swapped.
  • To determine the UTM zone, Settings -> Project properties -> Coordinate Reference System (CRS) -> Recently used coordinate reference systems, the project CRS will be highlighted in this section and, for a UTM CRS, should list the UTM zone.
  • Use the captured coordinates, UTM zone and date to determine the grid declination (angle between magnetic north and grid north) and its annual change (see my How to Determine Magnetic Declination Information for a Topographic Map post for details).
  • Use text and/or arrows to document the grid declination, the year for which it was determined and the annual change. Documenting the grid convergence angle is probably also a good idea.

When map composition is completed
  • Layout -> Move Item, or click the Toolbar button
  • Click on the map to select it (not on the Scale, Arrow, Title, etc.)
  • Item Properties -> Map
  • verify that the scale is still 1:50000 or whatever was set (sometimes it can be changed during map composition)
  • File -> Export as PDF, or click the Toolbar button
  • (If additional maps sheets will be required) File -> Save as template, saves the paper size, grid, scale, north arrow, text, etc. to be used when new print composers are created
  • Provide a meaningful name for the print composer template
  • In the main Quantum GIS window (not the QGIS Print Composer)
  • File -> Composer Manager..., or click the Toolbar button
  • Select the Print Composer that has just been completed and rename it to something meaningful
  • File -> Save Project, or click the Toolbar button

To compose additional maps in the same QGIS project
  • The above steps can be repeated as required to add multiple print composers to a QGIS project, a separate print composer should be defined for each separate map sheet required
  • To make this easier, a print composer template should be saved from the first print composer completed or from another project
  • In the main Quantum GIS window (not the QGIS Print Composer)
  • File -> New Print Composer, or click the toolbar button
  • In the QGIS Print Composer window (not the Quantum GIS window)
  • File ->Load from template
  • Select a saved Print Composer template
  • View -> Zoom Full, or click the Toolbar button
  • Click on Map will be printed here text to select the map (not on the Scale, Arrow, Title, etc.)
  • Item Properties -> Map
  • In the dropdown list box, change Rectangle to Cache
  • If required, click Update preview
  • Layout -> Move Content, or click the Toolbar button
  • Use the mouse to Pan (drag) and Zoom (mouse wheel) the map to the area of interest
  • Layout -> Move Item, or click the Toolbar button (this is required for selection in addition to move)
  • Click on the map to select it
  • Item Properties -> Map, set the Rotation (in degrees) to maximize the coastline shown on the page. Start by estimating the required rotation and adjust as required.
  • Re-adjust the area of interest that is displayed as required
  • Move, resize or update the Scale, Arrow, North arrow, Title, Declination information, etc. as required (see the steps above)
  • When completed, follow the When map composition is completed step above

Print the maps
  • Open the QGIS generated PDFs and print them. Ensure that automatic scaling, shrinking or fit to page are not enabled, if they are, the map scale will not be correct.
  • If the PDF page size is larger than the available printer paper size, the Adobe Reader print function using the Poster options (click the Poster button in the Adobe Reader print dialogue) can split it up onto multiple sheets of paper which can be taped or glued together if a single large sheet is required.

To reprint or edit the same maps later
  • Open Quantum GIS Desktop
  • File -> Open recent projects -> project name, to reopen the saved project
  • File -> Print Composers -> composer name, to reopen a saved print composer
  • Follow whichever steps from above are required

Click here for some links to useful mapping information and calculators.

6 comments:

  1. Thanks for this post - I was able to follow the directions easily and produce some nice custom maps for an upcoming trip. Saved me a lot of time vs figuring this out myself. Wish I knew about this years ago.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. thanks for the info. I appreciate.

    ReplyDelete
  4. Thanks for sharing how to make a nice map, I'm really loving this program!

    ReplyDelete
  5. Michael - I wanted to personally thank you for this excellent information. Very detailed instructions to use a powerful tool with fantastically free geospatial data to create FREE custom topo maps. I mean, I'm not sure many people realize how outstanding this is - particularly considering you can spend $25 or more for large sections maps that are cumbersome to carry. I applaud your effort in taking it on and figuring it out to the benefit of the rest of us. Hats off !

    ReplyDelete
  6. HATS off ! Thank you so much Michael. I'm not sure this has the momentum it deserves in the backpacking or hiking community. I mean, FREE custom topo maps at any scale on any page size (at least that's what it has enabled me to do). What an outstanding ability to have. I look forward to my next map and compass adventure. Cheers!

    ReplyDelete